2023-04-07 23:17:25 +08:00
|
|
|
from tkinter import *
|
|
|
|
from tkinter import messagebox
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
root = Tk()
|
|
|
|
root_1 = 'pip uninstall'
|
|
|
|
ok = '安装完成'
|
|
|
|
ok2 = '删除完成'
|
|
|
|
uninstall = 'pip uninstall'
|
2023-05-06 13:16:09 +08:00
|
|
|
ml = os.getcwd()
|
|
|
|
file_error = '文件丢失,请重新安装'
|
2023-04-07 23:17:25 +08:00
|
|
|
|
|
|
|
|
2023-05-05 12:33:22 +08:00
|
|
|
def open_exe(exe_name):
|
|
|
|
if os.path.exists(os.path.join(ml, f"{exe_name}.exe")):
|
|
|
|
os.system(f"start {exe_name}.exe")
|
|
|
|
else:
|
|
|
|
messagebox.showerror('install', file_error)
|
|
|
|
pass
|
|
|
|
pass
|
2023-05-05 13:34:36 +08:00
|
|
|
def GUI_delete():
|
|
|
|
open_exe('GUI_delete')
|
|
|
|
pass
|
|
|
|
def web_delete():
|
|
|
|
open_exe('web_delete')
|
|
|
|
pass
|
2023-04-07 23:17:25 +08:00
|
|
|
def pyinstaller_remove():
|
|
|
|
os.system('pip uninstall pyinstaller')
|
|
|
|
messagebox.showinfo('pip uninstall', ok2)
|
|
|
|
pass
|
|
|
|
def tqdm_remove():
|
|
|
|
os.system('pip uninstall tqdm')
|
|
|
|
messagebox.showinfo('pip uninstall', ok2)
|
|
|
|
pass
|
|
|
|
def nuitka_remove():
|
|
|
|
os.system('pip uninstall nuitka')
|
|
|
|
messagebox.showinfo(uninstall, ok2)
|
|
|
|
pass
|
|
|
|
def pywin32_remove():
|
|
|
|
os.system('pip uninstall pywin32')
|
|
|
|
messagebox.showinfo(uninstall, ok2)
|
|
|
|
pass
|
|
|
|
def numpy_remove():
|
|
|
|
os.system('pip uninstall numpy')
|
|
|
|
messagebox.showinfo(uninstall, ok2)
|
|
|
|
pass
|
2023-05-06 13:18:39 +08:00
|
|
|
def fh():
|
|
|
|
root.destroy()
|
2023-04-07 23:17:25 +08:00
|
|
|
# 按钮
|
2023-05-05 13:34:36 +08:00
|
|
|
remove_GUI = Button(root, text='GUI类删除', command=GUI_delete).pack()
|
|
|
|
remove_web = Button(root, text='web类删除', command=web_delete).pack()
|
2023-05-03 00:32:10 +00:00
|
|
|
remove_pyinstaller = Button(root, text='pyinstaller删除', command=pyinstaller_remove).pack()
|
2023-04-07 23:17:25 +08:00
|
|
|
remove_tqdm = Button(root, text='tqdm删除', command=tqdm_remove).pack()
|
|
|
|
remove_nuitka = Button(root, text='nuitka删除', command=nuitka_remove).pack()
|
|
|
|
remove_pywin32 = Button(root, text='pywin32删除', command=pywin32_remove).pack()
|
2023-05-06 13:18:39 +08:00
|
|
|
remove_numpy = Button(root ,text="numpy删除", command=numpy_remove).pack()
|
|
|
|
remove_fh = Button(root, text='返回', command=fh).pack()
|
2023-04-07 23:17:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
# 初始化程序
|
|
|
|
root.title('删除模式')
|
|
|
|
root.geometry('200x250+0+0')
|
|
|
|
root.mainloop()
|