有人有吗设置.py对我的程序有用的文件?我的整个程序是here。有什么方法可以导入一个dbm吗? 为了使我的exe能正常工作,我做了很多事情。这只是我最后一次尝试。在
这是设置.py文件我用来把我的程序变成一个exe文件。在
from cx_Freeze import setup, Executable
packages = []
for dbmodule in ['dbhash', 'gdbm', 'dbm', 'dumbdbm', 'gnu', 'ndbm', 'dumb',
'dbm.gnu', 'dbm.ndbm', 'dbm.dumb', 'gnudbm', 'ndbmdbm']:
try:
__import__(dbmodule)
except ImportError:
pass
else:
# If we found the module, ensure it's copied to the build directory.
packages.append(dbmodule)
build_exe_options = {'packages': ['os','sys','shelve']}
setup(name='RockPaperScissors-V2',
options = {"build_exe": build_exe_options},
version='0.1',
description='Classic game of Rock Paper Scissors',
executables = [Executable("RockPaperScissorsV2.py")])
我在运行exe程序时遇到这个错误。在
^{pr2}$
最后,经过多次测试,我终于找到了答案。其实很简单。我所要做的就是将
dbm
添加到转换文件中的包中。在相关问题 更多 >
编程相关推荐