pip-helper/client.pyw

50 lines
1.0 KiB
Python
Raw Permalink Normal View History

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-30 14:01:58 +08:00
ml = os.getcwd()
2023-04-27 21:56:53 +08:00
System = platform.system()
file_error = '文件丢失,请重新安装'
2023-04-30 14:01:58 +08:00
def jc(exe_name):
if os.path.exists(os.path.join(ml,f"{exe_name}.exe")):
os.system(f"start {exe_name}.exe")
2023-04-27 21:56:53 +08:00
else:
2023-04-30 14:01:58 +08:00
messagebox.showerror('system',file_error)
pass
def install():
jc("install")
2023-04-27 21:56:53 +08:00
2023-04-30 14:01:58 +08:00
def delete():
jc("delete")
2023-04-27 21:56:53 +08:00
2023-04-30 14:01:58 +08:00
def gk():
jc("gk")
2023-04-27 21:56:53 +08:00
def update():
2023-04-30 14:01:58 +08:00
jc("update")
2023-04-27 21:56:53 +08:00
def exit_exe():
2023-05-06 13:28:32 +08:00
os.system('taskkill -f -t -im python.exe')
2023-04-27 21:56:53 +08:00
root.destroy()
pass
# Button and Label
2023-04-30 14:01:58 +08:00
Label(root, text='pip_helper').pack()
Button(root, text='安装模式', command=install).pack()
Button(root, text='删除模式', command=delete).pack()
2023-04-27 21:56:53 +08:00
Button(root, text='更新日志', command=update).pack()
2023-04-30 14:01:58 +08:00
Button(root, text='关于', command=gk).pack()
2023-04-27 21:56:53 +08:00
Button(root, text='退出', command=exit_exe).pack()
# mainloop
root.title('启动器')
root.geometry('200x200+400+400')
root.mainloop()