From 1c1ff49f81ba6be30ab10503a595e128ec863d75 Mon Sep 17 00:00:00 2001 From: dengrb1 <125752069+dengrb1@users.noreply.github.com> Date: Fri, 5 May 2023 13:34:36 +0800 Subject: [PATCH] pip helper --- delete.py | 8 ++++++++ install.py | 12 +++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/delete.py b/delete.py index 873f3e2..0a47c18 100644 --- a/delete.py +++ b/delete.py @@ -17,6 +17,12 @@ def open_exe(exe_name): messagebox.showerror('install', file_error) pass pass +def GUI_delete(): + open_exe('GUI_delete') + pass +def web_delete(): + open_exe('web_delete') + pass def pyinstaller_remove(): os.system('pip uninstall pyinstaller') messagebox.showinfo('pip uninstall', ok2) @@ -38,6 +44,8 @@ def numpy_remove(): messagebox.showinfo(uninstall, ok2) pass # 按钮 +remove_GUI = Button(root, text='GUI类删除', command=GUI_delete).pack() +remove_web = Button(root, text='web类删除', command=web_delete).pack() remove_pyinstaller = Button(root, text='pyinstaller删除', command=pyinstaller_remove).pack() remove_tqdm = Button(root, text='tqdm删除', command=tqdm_remove).pack() remove_nuitka = Button(root, text='nuitka删除', command=nuitka_remove).pack() diff --git a/install.py b/install.py index 05386f5..9b0ff5b 100644 --- a/install.py +++ b/install.py @@ -11,13 +11,17 @@ file_error = '文件丢失,请重新安装' -def GUI_install(): - if os.path.exists(os.path.join(ml, "GUI_install.exe")): - os.system("start GUI_install.exe") +def open_exe(): + if os.path.exists(os.path.join(ml, f"{exe_name}.exe")): + os.system(f"start {exe_name}.exe") else: messagebox.showerror('install', file_error) pass pass +def gui_install(): + open_exe('GUI_install') +def web_install(): + open_exe('web_install') def pyinstaller(): os.system('pip install pyinstaller') messagebox.showinfo('pip install', ok) @@ -39,6 +43,8 @@ def numpy(): messagebox.showinfo(install_1, ok) pass # 按钮 +pip_gui = Button(root, text='GUI类安装', command=gui_install).pack() +pip_web = Button(root, text='web类安装', command=web_install).pack() pip_pyinstaller = Button(root, text='pyinstall安装', command=pyinstaller).pack() pip_tqdm = Button(root, text='tqdm安装', command=tqdm).pack() pip_nuitka = Button(root, text='nuitka安装', command=nuitka).pack()