pip-helper/GUI_install.pyw

90 lines
2.9 KiB
Python
Raw Normal View History

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"
2023-05-08 22:02:36 +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-01 15:41:19 +00:00
def pyqt5():
2023-05-11 22:03:12 +08:00
os.system("pip install pyqt5 -i https://mirrors.aliyun.com/pypi/simple/")
os.systen('pip install PyQtWebEngine -i https://mirrors.aliyun.com/pypi/simple/')
2023-05-01 15:41:19 +00:00
messagebox.showinfo(install, ok)
def wxpython():
2023-05-11 22:03:12 +08:00
os.system("pip install wxpython -i https://mirrors.aliyun.com/pypi/simple/")
2023-05-01 15:41:19 +00:00
messagebox.showinfo(install, ok)
def pygame():
2023-05-11 22:03:12 +08:00
os.system("pip install pygame -i https://mirrors.aliyun.com/pypi/simple/")
2023-05-01 15:41:19 +00:00
messagebox.showinfo(install, ok)
2023-05-07 09:59:57 +08:00
def Matplotlib():
2023-05-11 22:03:12 +08:00
os.system('pip install Matplotlib -i https://mirrors.aliyun.com/pypi/simple/')
2023-05-07 09:59:57 +08:00
messagebox.showinfo(install, ok)
def Seaborn():
2023-05-11 22:03:12 +08:00
os.system('pip install Seaborn -i https://mirrors.aliyun.com/pypi/simple/')
2023-05-07 09:59:57 +08:00
messagebox.showinfo(install, ok)
2023-05-06 13:23:18 +08:00
def fh():
root.destroy()
2023-05-08 22:02:36 +08:00
def kivy():
2023-05-11 22:03:12 +08:00
os.system('pip install kivy -i https://mirrors.aliyun.com/pypi/simple/')
2023-05-08 22:02:36 +08:00
messagebox.showinfo(install, ok)
def pysimpleGUI():
2023-05-11 22:03:12 +08:00
os.system('pip install pysimpleGUI -i https://mirrors.aliyun.com/pypi/simple/')
2023-05-08 22:02:36 +08:00
messagebox.showinfo(install, ok)
def pyside6():
2023-05-11 22:03:12 +08:00
os.system('pip install pyside6 -i https://mirrors.aliyun.com/pypi/simple/')
2023-05-08 22:02:36 +08:00
messagebox.showinfo(install ,ok)
def flexx():
2023-05-11 22:03:12 +08:00
os.system('pip install flexx -i https://mirrors.aliyun.com/pypi/simple/d')
2023-05-08 22:02:36 +08:00
messagebox.showinfo(install, ok)
2023-05-01 15:41:19 +00:00
# Button
2023-05-08 22:02:36 +08:00
bt_qt = Button(frame, text='pyqt5安装', command=pyqt5)
bt_pygame = Button(frame, text='pygame安装', command=pygame)
bt_matplotlib = Button(frame, text='matplotlib安装', command=Matplotlib)
bt_seaborn = Button(frame, text='Seaborn安装', command=Seaborn)
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-08 22:02:36 +08:00
bt_wx = Button(frame, text='wxpython安装', command=wxpython)
bt_fh = Button(frame, 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()
2023-05-08 22:02:36 +08:00
bt_pyside.pack()
bt_kivy.pack()
2023-05-01 15:41:19 +00:00
bt_pygame.pack()
2023-05-07 09:59:57 +08:00
bt_matplotlib.pack()
bt_seaborn.pack()
2023-05-08 22:02:36 +08:00
bt_flexx.pack()
bt_pysimpleGUI.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-09 18:21:57 +08:00
root.geometry('200x230+100+110')
2023-05-01 15:41:19 +00:00
root.mainloop()