Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling an IronPython code to EXE or DLL

Can I compile an IronPython code to EXE or DLL in a .NET runtime?

like image 976
Zippo Avatar asked Nov 10 '10 18:11

Zippo


2 Answers

Simply use clr.CompileModules in an IronPython script to convert it to a dll file. Or you can use pyc.py (found inside of your IronPythonInstallDirectory\Tools\Scripts) which can also generate an exe for you also.

like image 154
jcao219 Avatar answered Oct 17 '22 03:10

jcao219


If I really, really needed that I would create a wrapper DLL/EXE in another language. The Python code can then be stored as a resource in the DLL that is loaded when the assembly is first accessed.

like image 24
Jonathan Allen Avatar answered Oct 17 '22 03:10

Jonathan Allen