|
|

楼主 |
发表于 2017-9-7 17:01:11
|
显示全部楼层
本帖最后由 kaka201305 于 2017-9-7 17:02 编辑
cmd 下输入命令 pyinstaller c:\test001.py 可以生成test001.exe文件,也没发现报错,我在我的代码里写入try错误处理代码,双击est001.exe文件也没弹出任何信息,就是闪一下就不见,源代码运行正常。
import sys
import tkinter as tk
class APP:
def __init__(self,master):
frame=tk.Frame(master)
frame.pack()
self.button=tk.Button(frame,text="hello word",fg='blue',command=self.say_hi)
self.button.pack()
def say_hi(self):
print('*************')
try:
root=tk.Tk()
app=APP(root)
root.mainloop()
except:
print(sys.exc_info())
input('shuru') |
|