Python py2exe-单文件exe tkinter程序未执行
我使用以下代码来执行我的程序:Python py2exe-单文件exe tkinter程序未执行,python,tkinter,py2exe,Python,Tkinter,Py2exe,我使用以下代码来执行我的程序: from distutils. core import * import py2exe,sys,os sys.argv.append('py2exe') setup(options={'py2exe':{bundle_files':1,'compressed':True,'includes':["Tkinter",]}}'windows=['trial.py'],zipfile=None,) 它正在创建单个文件.exe,但未执行。 与bundle_file 3相
from distutils. core import *
import py2exe,sys,os
sys.argv.append('py2exe')
setup(options={'py2exe':{bundle_files':1,'compressed':True,'includes':["Tkinter",]}}'windows=['trial.py'],zipfile=None,)
它正在创建单个文件.exe
,但未执行。与
bundle_file 3相同的代码(没有单个文件)工作正常
trial.py:
import Tkinter
Tkinter.Tk()
mainloop()
请帮助我为GUI程序创建一个.exe
文件PyInstaller是一个更简单的选项,可以从控制台使用。只需pip安装pyinstaller
,输入程序目录,然后pyinstaller-yourscript.py
当我的机器出现错误时,你说trial.py
工作正常,这让我很困惑mainloop()
需要替换为Tkinter.mainloop()
如何使用?是。我使用的是Tkinter import*。我不知道pyinstaller在我的系统中不工作。我使用的是2.7便携式计算机