setup(console=['hello.py'])
我相信您要使用的行看起来像这样。
我用2个文件进行了测试:
你好
import sysfor arg in sys.argv: print argprint "Hello World!"
和setup.py
from distutils.core import setupimport py2exesetup(console=['hello.py'])
我运行了以下命令:
python setup.py py2exe
然后在dist文件夹中,我运行了此命令:
hello.exe foo bar
结果:
hello.exefoobarHello World!



