Using Py2Exe without command line

混江龙づ霸主 提交于 2019-12-23 02:03:36

问题


Is it possible to compile a python script with py2exe without calling py2exe from the command line?

>Python setup.py py2exe

I'd like to run it all from a script, but haven't found a way to do so.


回答1:


at the beginig of the setup.py

import sys

if len(sys.argv) == 1:
    sys.argv.append("py2exe")

this way, if setup.py is called without args or with a double click, it will start the packaging



来源:https://stackoverflow.com/questions/15551527/using-py2exe-without-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!