我试图解决这个问题两天: setup.py
from cx_Freeze import setup, Executable
executables = [Executable("main.py",base="Win32GUI")]
setup(
name="Life of Robert",
version = "1.0",
description = "An RPG with endless maps.",
options={
"build_exe":
{
"packages": ["pygame"],
"include_files": ['Images/','Sounds/','Maps/','Houses/'],
"includes": ["chest","gold","gui","message","player","settings","utils","wolf"],
},
},
executables = executables
)
每次我用python setup.py build
运行它时,我得到:
TypeError: source code string cannot contain null bytes
您可以在https://github.com/DrevanTonder/the-life-of-robert/blob/master/main.py
找到main.py.我尝试在记事本++中打开main.py
并显示隐藏的符号。
我在文件
nul
或\x00
符号
我正在使用python 3.4