python - py2exe 不工作 - 闪烁控制台并关闭
问题描述
EXE 打不开。我已经尝试了我在网上找到的所有东西。当我运行 exe 时,控制台会打开几秒钟然后关闭。我怎样才能使这个.py
可执行文件并有我的.txt
输出?
from tkinter import *
import time, os, fnmatch, shutil
screen = Tk()
screen.geometry("600x450")
screen.configure(background='azure')
screen.title("M")
t = time.localtime()
timestamp = time.strftime('%b-%d-%Y_%H%M', t)
BACKUP_NAME = ("backup-" + timestamp)
heading = Label(text = "Mr", font=(None, 15), bg = "lightblue", fg = "black", width = "500", height = "3")
heading.pack()
firstname_text = Label(text = "Name/ * ", bg = "azure",)
lastname_text = Label(text = "Usagel* ", bg = "azure",)
material_text = Label(text = "M * ", bg = "azure",)
age_text = Label(text = "How * ", bg = "azure",)
firstname_text.place(x = 15, y = 80)
lastname_text.place(x = 15, y = 140)
material_text.place(x = 15, y = 210)
age_text.place(x = 15, y = 260)
firstname = StringVar()
lastname = StringVar()
material = StringVar()
age = StringVar()
firstname_entry = Entry(textvariable = firstname, width = "30")
lastname_entry = Entry(textvariable = lastname, width = "30")
material_entry = Entry(textvariable = material, width = "30")
age_entry = Entry(textvariable = age, width = "30")
firstname_entry.place(x = 15, y = 100)
lastname_entry.place(x = 15, y = 170)
material_entry.place(x = 15, y = 240)
age_entry.place(x = 15, y = 290)
register = Button(screen,text = "Submit", font=(None, 10), width = "30", height = "2", command = save_info, bg = "lime green")
register.place(x = 15, y = 320)
解决方案
推荐阅读
- bash - 是否可以在单个脚本中包含包含 Fish 和 POSIX shell 的多语言 shell 文档?
- bash - 在 ps 中列为 (bash) 的进程,尽管会立即对其进行监控
- javascript - 映射函数返回未定义
- azure - Azurite 不适用于 VS Code 中的 Blob 触发器
- angular - 导航总是路由到 Angular 中的 NoFoundPage 页面问题
- mysql - Spring Data R2DBC 自定义转换不适用于 json 数组
- c# - WPF:使用 resx 文件进行白标(非本地化)
- solr - 独立 Solr 8 身份验证
- reactjs - 如何使用 youtube data api v3 参数 mine
- reactjs - React Query - 观察 useIsMutating 状态