2023-05-01 15:41:19 +00:00
|
|
|
from tkinter import *
|
|
|
|
from tkinter import messagebox
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
root = Tk()
|
|
|
|
ml = os.getcwd()
|
|
|
|
ok = "install OK!"
|
|
|
|
install = "Install"
|
|
|
|
|
|
|
|
def pyqt5():
|
|
|
|
os.system("pip install pyqt5")
|
2023-05-04 17:38:12 +08:00
|
|
|
os.systen('pip install PyQtWebEngine')
|
2023-05-01 15:41:19 +00:00
|
|
|
messagebox.showinfo(install, ok)
|
|
|
|
def wxpython():
|
|
|
|
os.system("pip install wxpython")
|
|
|
|
messagebox.showinfo(install, ok)
|
|
|
|
def pygame():
|
|
|
|
os.system("pip install pygame")
|
|
|
|
messagebox.showinfo(install, ok)
|
2023-05-07 09:59:57 +08:00
|
|
|
def Matplotlib():
|
|
|
|
os.system('pip install Matplotlib')
|
|
|
|
messagebox.showinfo(install, ok)
|
|
|
|
def Seaborn():
|
|
|
|
os.system('pip install Seaborn')
|
|
|
|
messagebox.showinfo(install, ok)
|
2023-05-06 13:23:18 +08:00
|
|
|
def fh():
|
|
|
|
root.destroy()
|
2023-05-01 15:41:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Button
|
|
|
|
bt_qt = Button(root, text='pyqt5安装', command=pyqt5)
|
|
|
|
bt_pygame = Button(root, text='pygame安装', command=pygame)
|
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-01 15:41:19 +00:00
|
|
|
bt_wx = Button(root, text='wxpython安装', command=wxpython)
|
2023-05-06 13:23:18 +08:00
|
|
|
bt_fh = Button(root, text='返回', command=fh)
|
2023-05-01 15:41:19 +00:00
|
|
|
|
|
|
|
# pack and Label
|
2023-05-07 09:59:57 +08:00
|
|
|
Label(root, text="GUI").pack()
|
2023-05-01 15:41:19 +00:00
|
|
|
bt_qt.pack()
|
|
|
|
bt_pygame.pack()
|
2023-05-07 09:59:57 +08:00
|
|
|
bt_matplotlib.pack()
|
|
|
|
bt_seaborn.pack()
|
2023-05-01 15:41:19 +00:00
|
|
|
bt_wx.pack()
|
2023-05-06 13:23:18 +08:00
|
|
|
bt_fh.pack()
|
2023-05-01 15:41:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
# mainloop
|
|
|
|
root.title("GUI")
|
2023-05-07 09:59:57 +08:00
|
|
|
root.geometry('200x230+400+400')
|
2023-05-01 15:41:19 +00:00
|
|
|
root.mainloop()
|