Ironpython 2.6.py - > 。可执行程序 [英] Ironpython 2.6 .py -> .exe
问题描述
我已经尝试使用py2exe(与ipy不兼容)和PYC(过期)。
结果将是两个文件, test.dll
和 test.exe
。 test.dll
将包含您的实际脚本代码,而 test.exe
只是一个启动器 test.dll
。如果包括文件,您可以将此EXE和DLL分发到其他未安装IronPython的计算机。
-
IronPython .dll
, -
Microsoft.Dynamic.dll
, -
Microsoft.Scripting.Core.dll
, -
Microsoft.Scripting.Debugging.dll
, -
Microsoft.Scripting.dll
, -
Microsoft.Scripting.ExtensionAttribute.dll
和 -
IronPython.Modules.dll
(有时需要)。
另请参阅博客条目 IronPython - 如何编译exe 。
I already attempted using py2exe (not compatible with ipy) and PYC (out of date). Can anyone point me in the direction of a good compiler?
You can use pyc.py
, the Python Command-Line Compiler, which is included in IronPython since version 2.6 to compile a Python script to an executable. You find it at %IRONPYTONINSTALLDIR%\Tools\Scripts\pyc.py
on your hard disk.
Example
Let's assume you have a simple script test.py
that just prints out something to console. You can turn this into an executable with the following command-line (assuming that the IronPython directory is the current directory and that test.py
is in there, too):
ipy.exe Tools\Scripts\pyc.py /main:test.py /target:exe
Note: If you are using forms and don't want a console window to open, you want to use /target:winexe
instead of /target:exe
.
The result will be two files, test.dll
and test.exe
. test.dll
will contain your actual script code, while test.exe
is just a launcher for test.dll
. You can distribute this EXE and DLL to other computers which do not have IronPython installed if you include the files
IronPython.dll
,Microsoft.Dynamic.dll
,Microsoft.Scripting.Core.dll
,Microsoft.Scripting.Debugging.dll
,Microsoft.Scripting.dll
,Microsoft.Scripting.ExtensionAttribute.dll
andIronPython.Modules.dll
(sometimes needed).
Also see the blog entry IronPython - how to compile exe.
这篇关于Ironpython 2.6.py - > 。可执行程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!