2023-04-27 21:56:53 +08:00
|
|
|
from tkinter import *
|
2023-04-27 22:22:00 +08:00
|
|
|
from tkinter import messagebox
|
2023-05-12 19:30:07 +08:00
|
|
|
import sys
|
2023-08-27 11:45:22 +08:00
|
|
|
import subprocess
|
2023-04-27 21:56:53 +08:00
|
|
|
import os
|
|
|
|
|
|
|
|
root = Tk()
|
2023-04-30 14:01:58 +08:00
|
|
|
ml = os.getcwd()
|
2023-08-27 11:45:22 +08:00
|
|
|
setting_ml = f"{ml}\setting\\"
|
2023-04-27 21:56:53 +08:00
|
|
|
file_error = '文件丢失,请重新安装'
|
|
|
|
|
|
|
|
|
2023-04-30 14:01:58 +08:00
|
|
|
def jc(exe_name):
|
2023-08-27 11:45:22 +08:00
|
|
|
if os.path.exists(os.path.join(ml, f"{exe_name}.exe")):
|
|
|
|
subprocess.Popen(f"{exe_name}.exe", shell=True)
|
2023-04-27 21:56:53 +08:00
|
|
|
else:
|
2023-08-27 11:45:22 +08:00
|
|
|
messagebox.showerror('system', file_error)
|
|
|
|
|
|
|
|
|
2023-04-30 14:01:58 +08:00
|
|
|
def install():
|
|
|
|
jc("install")
|
2023-04-27 21:56:53 +08:00
|
|
|
|
2023-08-27 11:45:22 +08:00
|
|
|
|
2023-04-30 14:01:58 +08:00
|
|
|
def delete():
|
|
|
|
jc("delete")
|
2023-04-27 21:56:53 +08:00
|
|
|
|
2023-08-27 11:45:22 +08:00
|
|
|
|
2023-04-27 21:56:53 +08:00
|
|
|
def update():
|
2023-08-27 11:45:22 +08:00
|
|
|
if os.path.exists(os.path.join(setting_ml, "update.pyw")):
|
|
|
|
subprocess.Popen(f"{setting_ml}update.pyw", shell=True)
|
|
|
|
else:
|
|
|
|
messagebox.showerror('system', file_error)
|
|
|
|
|
2023-04-27 21:56:53 +08:00
|
|
|
|
|
|
|
def exit_exe():
|
|
|
|
root.destroy()
|
2023-08-27 11:45:22 +08:00
|
|
|
|
2023-04-27 21:56:53 +08:00
|
|
|
|
2023-05-07 17:58:36 +08:00
|
|
|
def eyeryone():
|
|
|
|
messagebox.showerror('pip helper', '暂时无法使用,因为程序测试途中出现未知问题......')
|
|
|
|
|
2023-04-27 21:56:53 +08:00
|
|
|
|
|
|
|
# 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()
|
|
|
|
Button(root, text='退出', command=exit_exe).pack()
|
|
|
|
|
2023-05-12 21:48:14 +08:00
|
|
|
Label(root, text='version 1.6 @2023-2024 dengrb1').pack()
|
2023-05-12 20:54:08 +08:00
|
|
|
|
2023-04-27 21:56:53 +08:00
|
|
|
# mainloop
|
2023-05-12 20:54:08 +08:00
|
|
|
root.title('选择')
|
2023-05-07 17:58:36 +08:00
|
|
|
root.geometry('200x220+400+400')
|
2023-08-27 11:45:22 +08:00
|
|
|
root.mainloop()
|