From 8505f93fab6efba431064dc5bd2cbb0bef41a9d9 Mon Sep 17 00:00:00 2001 From: dengrb1 <125752069+dengrb1@users.noreply.github.com> Date: Sat, 26 Aug 2023 11:06:40 +0800 Subject: [PATCH] 2023/8/26 update --- GUI_delete.pyw | 9 ++--- game_install.pyw | 87 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 7 deletions(-) create mode 100644 game_install.pyw diff --git a/GUI_delete.pyw b/GUI_delete.pyw index 3915a53..c19221e 100644 --- a/GUI_delete.pyw +++ b/GUI_delete.pyw @@ -36,10 +36,6 @@ def wxpython(): os.system('pip uninstall wxpython') messagebox.showinfo('pip uninstall', ok2) pass -def pygame(): - os.system('pip uninstall pygame') - messagebox.showinfo('pip uninstall', ok2) - pass def Matplotlib(): os.system('pip uninstall Matplotlib') messagebox.showinfo(uninstall, ok2) @@ -62,8 +58,8 @@ def fh(): root.destroy() # button +bt_fh = Button(frame, text='返回', command=fh) bt_qt = Button(root, text='pyqt5删除', command=pyqt) -bt_pygame = Button(root, text='pygame删除', command=pygame) bt_wx = Button(frame, text='wxpython删除', command=wxpython) bt_kivy = Button(frame, text='kivy删除', command=kivy) bt_pyside = Button(frame, text='pyside6删除', command=pyside6) @@ -71,7 +67,7 @@ bt_flexx = Button(frame, text='flexx删除', command=flexx) bt_matplotlib = Button(frame, text='matplatlib删除', command=Matplotlib) bt_seaborn = Button(frame, text='seaborn删除', command=Seaborn) bt_pysimpleGUI = Button(frame, text='pysimpleGUI删除', command=pysimpleGUI) -bt_fh = Button(frame, text='返回', command=fh) + # pack and Label Label(root, text='GUI删除').pack() @@ -79,7 +75,6 @@ bt_fh.pack() bt_qt.pack() bt_pyside.pack() bt_kivy.pack() -bt_pygame.pack() bt_matplotlib.pack() bt_seaborn.pack() bt_flexx.pack() diff --git a/game_install.pyw b/game_install.pyw new file mode 100644 index 0000000..15eab78 --- /dev/null +++ b/game_install.pyw @@ -0,0 +1,87 @@ +import os +import sys +from tkinter import * +from tkinter import messagebox + +root = Tk() +ml = os.getcwd() +ok = "install OK!" +install = "Install" +i = "-i https://mirrors.aliyun.com/pypi/simple/" + +# 创建滚动区域的Canvas对象 +canvas = Canvas(root, width=280, height=280, scrollregion=(0, 0, 500, 500)) + +# 创建可滚动区域的Frame对象,并将其添加到Canvas中 +frame = Frame(canvas) +frame.bind("", 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) + + +# def +def pygame(): + os.system(f'pip install pygame {i}') + messagebox.showinfo(install, ok) +def pyglet(): + os.system(f'pip install pyglet {i}') + messagebox.showinfo(install,ok) +def pyopengl(): + os.system(f'pip install pyopengl {i}') + messagebox.showinfo(install, ok) +def pyode(): + os.system(f'pip install pyode {i}') + messagebox.showinfo(install ,ok) +def panda3d(): + os.system(f'pip install panda3d {i}') + messagebox.showinfo(install ,ok) +def cocos2d(): + os.system(f'pip install cocos2d {i}') + messagebox.showinfo(install, ok) +def kivy(): + os.system(f'pip install kivy {i}') + messagebox.showinfo(install, ok) +def arcade(): + os.system(f'pip install arcade {i}') + messagebox.showinfo(install, ok) +def fh(): + sys.exit() + pass + + +# Button +bt_fh = Button(frame, text='返回', command=fh) +bt_pygame = Button(frame, text='pygame安装', command=pygame) +bt_pyglet = Button(frame ,text='pyglet安装', command=pyglet) +bt_pyode = Button(frame, text='pyode安装', command=pyode) +bt_panda3d = Button(frame, text='panda3d安装', command=panda3d) +bt_cocos2d = Button(frame, text='cocos2d安装', command=cocos2d) +bt_kivy = Button(frame ,text='kivy安装', command=kivy) +bt_arcade = Button(frame, text='arcade安装', command=arcade) +bt_pyopengl = Button(frame, text='pyopenGL安装', command=pyopengl) + +# pack +Label(root, text='游戏库安装') +bt_fh.pack() +bt_pygame.pack() +bt_pyopengl.pack() +bt_pyglet.pack() +bt_pyode.pack() +bt_panda3d.pack() +bt_cocos2d.pack() +bt_kivy.pack() +bt_arcade.pack() + + +# mainloop +root.title('game') +root.geometry('200x300+100+80') +root.mainloop() +