Converts Python source to C#
Converts Python source to C#
pytocs is a command line tool I wrote as a hobby project to convert Python source code to C#. I've uploaded it here in case someone finds it useful.
Just git clone the project, and use Visual Studio or MSBuild to compile the pytocs.sln file. If you're unable or unwilling to build pytocs from source, the latest continuous integration build
is available at appveyor.com.
To convert a Python file, hand it to pytocs:
pytocs foo.pyTo convert all files in a directory (recursively), use the -r parameter:
pytocs -r The following python fragment:
# Some code below
def hello():
print "Hello World";Translates to:
public static class hello {
public static object hello() {
Console.WriteLine("Hello World");
}
}A more ambitious sample:
…Translates to:
…The next big items on the list are:
object.No open issues yet, or sync has not completed.