Python code generator for Visual Studio

code generationpythonvisual-studio-2008

I had an idea, if I add a python .py file to my C# project, and tag the file with a custom generator that would execute the python file, and treat the output as the result of the code generation, ie. put it into a C# file, that would allow me to do quite a lot of code generation as part of the build process.

Does anyone know if such a custom generator for Visual Studio 2008 exists?

Best Answer

OK, I see. Well, as far as I know there isn't any code generator for Python. There is a good introduction on how to roll your own here.

Actually, that's quite an under-used part of the environment, I suppose it's so because it needs you to use the IDE to compile the project, as it'd seem only the IDE knows about these "generators", but MSBuild ignores them.