From 25c0b4fc2c8eafba23ca03bb17d4910f1d5e20c1 Mon Sep 17 00:00:00 2001 From: dengrb1 <125752069+dengrb1@users.noreply.github.com> Date: Mon, 1 May 2023 15:41:19 +0000 Subject: [PATCH] install --- install/GUI_install.pyw | 37 ++++++++++++++++++++++++++++++++ install.py => install/install.py | 26 +++++++++------------- 2 files changed, 47 insertions(+), 16 deletions(-) create mode 100644 install/GUI_install.pyw rename install.py => install/install.py (69%) diff --git a/install/GUI_install.pyw b/install/GUI_install.pyw new file mode 100644 index 0000000..04cfbfd --- /dev/null +++ b/install/GUI_install.pyw @@ -0,0 +1,37 @@ +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") + 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) + + +# Button +bt_qt = Button(root, text='pyqt5安装', command=pyqt5) +bt_pygame = Button(root, text='pygame安装', command=pygame) +bt_wx = Button(root, text='wxpython安装', command=wxpython) + +# pack and Label +Label(root, text="GUI install").pack() +bt_qt.pack() +bt_pygame.pack() +bt_wx.pack() + + +# mainloop +root.title("GUI") +root.geometry('200x200+400+400') +root.mainloop() \ No newline at end of file diff --git a/install.py b/install/install.py similarity index 69% rename from install.py rename to install/install.py index 427f332..adee2a7 100644 --- a/install.py +++ b/install/install.py @@ -6,29 +6,26 @@ import os root = Tk() ok = '安装完成' install_1 = 'pip install' +ml = os.getcwd() +file_error = '文件丢失,请重新安装' + +def GUI_install(): + if os.path.exists(os.path.join(ml, "GUI_install.exe")): + os.system("start GUI_install.exe") + else: + messagebox.showerror('install', file_error) + pass + pass def pyinstaller(): os.system('pip install pyinstaller') messagebox.showinfo('pip install', ok) pass -def pygame(): - os.system('pip install pygame') - messagebox.showinfo('pip install', ok) - pass -def pyqt(): - os.system('pip install pyqt5') - os.system('pip install PyQtWebEngine') - messagebox.showinfo('pip install', ok) - pass def Requests(): os.system('pip install Requests') messagebox.showinfo('pip install', ok) pass -def wxpython(): - os.system('pip install wxpython') - messagebox.showinfo('pip install', ok) - pass def nuitka(): os.system('pip install nuitka') messagebox.showinfo('pip install', ok) @@ -51,10 +48,7 @@ def numpy(): pass # 按钮 pip_pyinstaller = Button(root, text='pyinstall安装', command=pyinstaller).pack() -pip_pygame = Button(root, text='pygame安装', command=pygame).pack() -pip_pyqt = Button(root, text='pyqt5安装', command=pyqt).pack() pip_Requests = Button(root, text='Requests安装', command=Requests).pack() -pip_wxpython = Button(root, text='wxpython安装', command=wxpython).pack() pip_tqdm = Button(root, text='tqdm安装', command=tqdm).pack() pip_nuitka = Button(root, text='nuitka安装', command=nuitka).pack() pip_pywin32 = Button(root, text='pywin32安装', command=pywin32).pack()