Python弹窗提醒:切换至AC/DC模式并打开计算器
import tkinter as tk
import subprocess
# 创建主窗口
root = tk.Tk()
root.withdraw() # 隐藏主窗口
# 创建弹窗
msg = tk.messagebox.showinfo(title='提示', message='请切换至AC/DC模式')
if msg == 'ok':
# 打开计算器
subprocess.Popen('calc.exe')
# 显示主窗口
root.deiconify()
root.mainloop()
原文地址: https://www.cveoy.top/t/topic/osJZ 著作权归作者所有。请勿转载和采集!