Hi does anyone know if you can compile Python code into a Windows DLL file? How would you go about doing this?
-
I've found a way to compile to EXE using py2exe. But still looking for way to make DLL. I want to use the DLL in a C# project.Martin– Martin2011-03-18 12:29:58 +00:00Commented Mar 18, 2011 at 12:29
-
2From your comment I guess you want to integrate Python with .NET. If so, there's IronPython, which goes much further than just creating a DLL.user395760– user3957602011-03-18 13:42:15 +00:00Commented Mar 18, 2011 at 13:42
Add a comment
|
1 Answer
One way would be to create a C or C++ library that embeds the Python interpreter and runs your Python code.
Another option would be to translate you Python code to C++ with ShedSkin and make that a DLL, although I wouldn't expect a very clean API to come out of this.
1 Comment
S.Lott
+1: Option 1 is the way it's supposed to be done. Just embed Python in your app.