##########################################################################################################
方法一:编写setup脚本,无论w还L均可用
How to compile under both Linux and MS Windows...
1. If the file we want to package as an executable is named walking_birdy_1.py in a folder called /constr, then we prepare a special setup file as follows.
脚本如下:
#setup.py
from cx_Freeze import setup, Executable
setup(executables=[Executable("/constr/walking_birdy_1.py")])
处理对象是/constr下的walking_birdy_1.py
2. Save it as setup.py.
存储
3. Then, in a command terminal run
python /constr/setup.py build
终端执行这个文件setup.py