我有一个用Python编写的中型程序,我想在Windows上使其可用。我尝试使用setup.py将cx_Freeze用于此目的,如下所示:
from cx_Freeze import setup, Executable
import os
os.environ['TCL_LIBRARY'] = "C:\\Users\w1kl4s\AppData\Local\Programs\Python\Python37-32\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "C:\\Users\w1kl4s\AppData\Local\Programs\Python\Python37-32\\tcl\\tk8.6"
executables = [Executable("main.py", base=None)]
packages = [some, packages]
options = {
'build_exe': {
'packages':packages,
},
}
setup(
name = "ProgramNAme",
options = options,
version = "1.0",
executables = executables
)
但是,main.py从目录中导入其他python文件,这些文件也从目录中导入其他文件。
项目树看起来像这样
├── main.py
└── src
├── calculatehash.py
├── calculatesizeandhash.py
└── calculatesize.py
然后calculatesizeandhash.py导入calculatesize.py和calculatehash.py文件。
如果可能的话,我真的不想创建更多的exe文件(不知道)
我应该如何处理?