pip-helper/GUI_delete.pyw

93 lines
2.8 KiB
Python
Raw Normal View History

2023-05-03 00:32:10 +00:00
from tkinter import *
from tkinter import messagebox
import os
root = Tk()
ml = os.getcwd()
file_error = '文件丢失!请重新安装'
ok2 = "删除完成"
2023-05-07 09:59:57 +08:00
uninstall = 'pip uninstall'
2023-05-03 00:32:10 +00:00
2023-05-09 13:21:54 +08:00
# 创建滚动区域的Canvas对象
canvas = Canvas(root, width=280, height=280, scrollregion=(0, 0, 500, 500))
# 创建可滚动区域的Frame对象并将其添加到Canvas中
frame = Frame(canvas)
frame.bind("<Configure>", lambda e: canvas.configure(scrollregion=canvas.bbox("all")))
canvas.create_window((0, 0), window=frame, anchor="nw")
# 创建Scrollbar对象并将其绑定到Canvas上
scrollbar = Scrollbar(root, orient="vertical", command=canvas.yview)
canvas.configure(yscrollcommand=scrollbar.set)
scrollbar.pack(side="right", fill="y")
# 显示Canvas和Scrollbar
canvas.pack(side="left", fill="both", expand=True)
2023-05-03 00:32:10 +00:00
def pyqt_remove():
os.system('pip uninstall pyqt5')
os.systen('pip uninstall PyQtWebEngine')
messagebox.showinfo('pip uninstall', ok2)
pass
def wxpython_remove():
os.system('pip uninstall wxpython')
messagebox.showinfo('pip uninstall', ok2)
pass
def pygame_remove():
os.system('pip uninstall pygame')
messagebox.showinfo('pip uninstall', ok2)
pass
2023-05-07 09:59:57 +08:00
def Matplotlib():
os.system('pip uninstall Matplotlib')
messagebox.showinfo(uninstall, ok2)
def Seaborn():
os.system('pip uninstall Seaborn')
messagebox.showinfo(uninstall, ok2)
2023-05-08 22:05:16 +08:00
def kivy():
os.system('pip uninstall kivy')
messagebox.showinfo(uninstall, ok2)
def pysimpleGUI():
os.system('pip uninstall pysimpleGUI')
messagebox.showinfo(uninstall, ok2)
def pyside6():
os.system('pip uninstall pyside6')
messagebox.showinfo(uninstall ,ok2)
def flexx():
os.system('pip uninstall flexx')
messagebox.showinfo(uninstall, ok2)
2023-05-06 13:23:18 +08:00
def fh():
root.destroy()
2023-05-03 00:32:10 +00:00
# button
bt_pq5 = Button(root, text='pyqt5删除', command=pyqt_remove)
bt_pygame = Button(root, text='pygame删除', command=pygame_remove)
2023-05-07 09:59:57 +08:00
bt_matplotlib = Button(root, text='matplotlib删除', command=Matplotlib)
bt_seaborn = Button(root, text='Seaborn删除', command=Seaborn)
2023-05-08 22:05:16 +08:00
bt_kivy = Button(frame, text='kivy删除', command=kivy)
bt_pyside = Button(frame, text='pyside6删除', command=pyside6)
bt_flexx = Button(frame, text='flexx删除', command=flexx)
2023-05-09 13:21:54 +08:00
bt_pysimpleGUI = Button(frame, text='pysimpleGUI删除', command=pysimpleGUI)
2023-05-03 00:32:10 +00:00
bt_wxpython = Button(root, text='wxpython删除', command=wxpython_remove)
2023-05-06 13:23:18 +08:00
bt_fh = Button(root, text='返回', command=fh)
2023-05-03 00:32:10 +00:00
# pack and Label
Label(root, text='GUI删除').pack()
2023-05-08 22:05:16 +08:00
bt_qt.pack()
bt_pyside.pack()
bt_kivy.pack()
2023-05-03 00:32:10 +00:00
bt_pygame.pack()
2023-05-07 09:59:57 +08:00
bt_matplotlib.pack()
bt_seaborn.pack()
2023-05-08 22:05:16 +08:00
bt_flexx.pack()
bt_pysimpleGUI.pack()
bt_wx.pack()
2023-05-06 13:23:18 +08:00
bt_fh.pack()
2023-05-03 00:32:10 +00:00
# mainloop
root.title('GUI')
2023-05-07 09:59:57 +08:00
root.geometry('200x230+400+500')
2023-05-03 00:32:10 +00:00
root.mainloop()