2023-04-27 21:56:53 +08:00
|
|
|
from tkinter import *
|
2023-04-27 22:22:00 +08:00
|
|
|
from tkinter import messagebox
|
2023-04-27 21:56:53 +08:00
|
|
|
import platform
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
root = Tk()
|
2023-04-29 15:40:38 +08:00
|
|
|
CURRENT_DIR = os.getcwd()
|
2023-04-27 21:56:53 +08:00
|
|
|
System = platform.system()
|
|
|
|
file_error = '文件丢失,请重新安装'
|
|
|
|
|
|
|
|
|
|
|
|
def windows_run():
|
2023-04-29 15:40:38 +08:00
|
|
|
if os.path.exists(os.path.join(CURRENT_DIR, "system_cz.exe")):
|
|
|
|
os.system("start system_cz.exe")
|
2023-04-27 21:56:53 +08:00
|
|
|
else:
|
2023-04-29 15:40:38 +08:00
|
|
|
messagebox.showerror('update', '重要文件丢失')
|
2023-04-27 21:56:53 +08:00
|
|
|
|
|
|
|
def Not_windows_run():
|
2023-04-29 15:40:38 +08:00
|
|
|
if os.path.exists(os.path.join(CURRENT_DIR, "system_command.py")):
|
|
|
|
os.system("python system_command.py")
|
2023-04-27 21:56:53 +08:00
|
|
|
else:
|
2023-04-29 15:40:38 +08:00
|
|
|
messagebox.showerror('update', '重要文件丢失')
|
2023-04-27 21:56:53 +08:00
|
|
|
|
|
|
|
def system_jc():
|
|
|
|
if System != 'Windows':
|
|
|
|
Not_windows_run()
|
|
|
|
else:
|
|
|
|
windows_run()
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
|
|
|
|
def update():
|
|
|
|
messagebox.showwarning('system', '暂无做完')
|
|
|
|
pass
|
|
|
|
|
|
|
|
def exit_exe():
|
|
|
|
root.destroy()
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
# Button and Label
|
|
|
|
Label(root, text='启动器').pack()
|
|
|
|
Button(root, text='启动程序', command=system_jc).pack()
|
|
|
|
Button(root, text='更新日志', command=update).pack()
|
|
|
|
Button(root, text='退出', command=exit_exe).pack()
|
|
|
|
|
|
|
|
|
|
|
|
# mainloop
|
|
|
|
root.title('启动器')
|
|
|
|
root.geometry('200x200+400+400')
|
|
|
|
root.mainloop()
|