使用py2exe的多个控制台命令

Aji*_*jit 5 python windows py2exe python-2.x python-packaging

我目前setup.py有三个console_scripts条目:

console_scripts=[
    ‘myapp-dev=bin/run:dev',
    ‘myapp=bin/run:prod',
    ‘myapp-cmd-line=bin/run:cmd'
]
Run Code Online (Sandbox Code Playgroud)

run.py 包含这些的简单函数:

#!/usr/bin/env python

myapp = App()

def dev():
    myapp.run(mode='dev')

def prod():
    myapp.run()

def cmdline():
    myapp.run(mode='cmd')
Run Code Online (Sandbox Code Playgroud)

有没有办法可以.exe为上面的每一个创建3个单独的文件