以下是Python代码实现:

import tkinter as tk
import subprocess

# 创建主窗口
root = tk.Tk()
root.title('切换模式提示')

# 创建标签
label = tk.Label(root, text='请切换至AC/DC模式')
label.pack()

# 创建确认按钮
def open_calculator():
    subprocess.Popen('calc.exe')
    root.destroy()

button = tk.Button(root, text='确认', command=open_calculator)
button.pack()

# 进入消息循环
root.mainloop()

运行代码后,会弹出一个名为'切换模式提示'的窗口,上面有一个提示信息和一个确认按钮。点击确认按钮后,会打开计算器。

Python弹窗提示切换模式并打开计算器

原文地址: https://www.cveoy.top/t/topic/or33 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录