From 7e9c3ebd54f4cd24731fa1207752ab1b5d5af37b Mon Sep 17 00:00:00 2001 From: dengrb1 <125752069+dengrb1@users.noreply.github.com> Date: Sat, 6 May 2023 22:53:43 +0800 Subject: [PATCH] pip helper --- comput_install.pyw | 38 ++++++++++++++++++++++++++++++++++++++ computer_delete.pyw | 38 ++++++++++++++++++++++++++++++++++++++ delete.pyw | 3 +++ install.pyw | 3 +++ 4 files changed, 82 insertions(+) create mode 100644 comput_install.pyw create mode 100644 computer_delete.pyw diff --git a/comput_install.pyw b/comput_install.pyw new file mode 100644 index 0000000..a2f9d55 --- /dev/null +++ b/comput_install.pyw @@ -0,0 +1,38 @@ +from tkinter import * +from tkinter import messagebox +import os + + +root = Tk() +ml = os.getcwd() +file_error = '文件丢失,请重新安装' +ok = '安装完成' +install = 'pip install' + + +# def +def tensorFlow(): + os.system('pip install TensorFlow') + messagebox.showinfo(install, ok) +def pytorch(): + os.system('pip install pytorch') + messagebox.showinfo(install, ok) +def fh(): + root.destroy() + +# Button +bt_tensorFlow = Button(root, text='TensorFlow安装', command=tensorFlow) +bt_pytorch = Button(root, text='pytorch安装', command=pytorch) +bt_fh = Button(root, text='返回', command=fh) + +# pack +Label(root, text='机器学习类库安装').pack() +bt_tensorFlow.pack() +bt_pytorch.pack() +bt_fh.pack() + + +# mainloop +root.title('install') +root.geometry('150x150+400+700') +root.mainloop() \ No newline at end of file diff --git a/computer_delete.pyw b/computer_delete.pyw new file mode 100644 index 0000000..e31e914 --- /dev/null +++ b/computer_delete.pyw @@ -0,0 +1,38 @@ +from tkinter import * +from tkinter import messagebox +import os + + +root = Tk() +ml = os.getcwd() +file_error = '文件丢失,请重新安装' +uninstall = 'pip uninstall' +ok = '删除完成' + + +# def +def TensorFlow(): + os.system('pip uninstall TensorFlow') + messagebox.showinfo(uninstall, ok) +def pytorch(): + os.system('pip uninstall pytorch') + messagebox.showinfo(uninstall, ok) +def fh(): + root.destroy() + +# Button +bt_TensorFlow = Button(root, text='TensorFlow删除', command=TensorFlow) +bt_pytorch = Button(root, text='pytorch删除', command=pytorch) +bt_fh = Button(root, text='返回', command=fh) + +# pack +Label(root, text='机器学习类库删除').pack() +bt_TensorFlow.pack() +bt_pytorch.pack() +bt_fh.pack() + + +# mainloop +root.title('delete') +root.geometry('150x150+400+650') +root.mainloop() \ No newline at end of file diff --git a/delete.pyw b/delete.pyw index 87c80d4..ffa2e2c 100644 --- a/delete.pyw +++ b/delete.pyw @@ -37,6 +37,8 @@ def GUI_delete(): def web_delete(): open_exe('web_delete') pass +def computer_delete(): + open_exe('computer_delete') def pyinstaller_remove(): os.system('pip uninstall pyinstaller') messagebox.showinfo('pip uninstall', ok2) @@ -64,6 +66,7 @@ def fh(): # Button remove_GUI = Button(frame, text='GUI类删除', command=GUI_delete).pack() remove_web = Button(frame, text='web类删除', command=web_delete).pack() +remove_computer = Button(frame, text='机器学习类删除', command=computer_delete).pack() remove_pyinstaller = Button(frame, text='pyinstaller删除', command=pyinstaller_remove).pack() remove_tqdm = Button(frame, text='tqdm删除', command=tqdm_remove).pack() remove_nuitka = Button(frame, text='nuitka删除', command=nuitka_remove).pack() diff --git a/install.pyw b/install.pyw index 0ebe64f..7535a88 100644 --- a/install.pyw +++ b/install.pyw @@ -39,6 +39,8 @@ def gui_install(): open_exe('GUI_install') def web_install(): open_exe('web_install') +def computer_install(): + open_exe('computer_install') def pyinstaller(): os.system('pip install pyinstaller') messagebox.showinfo('pip install', ok) @@ -65,6 +67,7 @@ def fh(): # Button pip_gui = Button(frame, text='GUI类安装', command=gui_install).pack() pip_web = Button(frame, text='web类安装', command=web_install).pack() +pip_computer = Button(frame, text='机器学习类库安装', command=computer_install).pack() pip_pyinstaller = Button(frame, text='pyinstall安装', command=pyinstaller).pack() pip_tqdm = Button(frame, text='tqdm安装', command=tqdm).pack() pip_nuitka = Button(frame, text='nuitka安装', command=nuitka).pack()