Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python code generator for Visual Studio?

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?

like image 762
Lasse V. Karlsen Avatar asked Jan 24 '23 04:01

Lasse V. Karlsen


2 Answers

I think Cog does what you want.

like image 197
jwfearn Avatar answered Feb 04 '23 09:02

jwfearn


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.

like image 21
dguaraglia Avatar answered Feb 04 '23 10:02

dguaraglia