From fbf21c7259c81f22344afde81de75d4d274610e3 Mon Sep 17 00:00:00 2001 From: dengrb1 <125752069+dengrb1@users.noreply.github.com> Date: Wed, 10 May 2023 17:36:23 +0800 Subject: [PATCH] pip helper --- web_delete.pyw | 60 ++++++++++++++++++++++----- web_delete2.pyw | 86 --------------------------------------- web_install.pyw | 62 +++++++++++++++++++++++----- web_install2.pyw | 88 ---------------------------------------- 没有使用/web_delete.pyw | 46 +++++++++++++++++++++ 没有使用/web_install.pyw | 48 ++++++++++++++++++++++ 6 files changed, 195 insertions(+), 195 deletions(-) delete mode 100644 web_delete2.pyw delete mode 100644 web_install2.pyw create mode 100644 没有使用/web_delete.pyw create mode 100644 没有使用/web_install.pyw diff --git a/web_delete.pyw b/web_delete.pyw index 4aab77e..420b779 100644 --- a/web_delete.pyw +++ b/web_delete.pyw @@ -2,45 +2,85 @@ from tkinter import * from tkinter import messagebox import os - +# 定义内容和创建主窗口 root = Tk() ml = os.getcwd() -file_error = '文件丢失,请重新安装' -ok2 = '删除完成' +ok2 = '安装成功' uninstall = 'pip uninstall' +file_error = '文件丢失,请重新安装' +# 创建滚动区域的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 open_exe(exe_name): if os.path.exists(os.path.join(ml, f"{exe_name}.exe")): os.system(f"start {exe_name}.exe") else: messagebox.showerror('delete', file_error) pass -def Requests_remove(): +def Requests(): os.system('pip uninstall Requests') messagebox.showinfo('pip uninstall', ok2) pass -def django_remove(): +def django(): os.system('pip uninstall django') messagebox.showinfo(uninstall, ok2) pass +def fastAPI(): + os.system('pip uninstall fastapi') + messagebox.showinfo(uninstall, ok2) +def sanic(): + os.system('pip uninstall sanic') + messagebox.showinfo(uninstall, ok2) +def nameko(): + os.system('pip uninstall nameko') + messagebox.showinfo(uninstall, ok2) +def pydantic(): + os.system('pip uninstall pydantic') + messagebox.showinfo(uninstall, ok2) def fh(): root.destroy() pass # Button -bt_r = Button(root, text='Requests删除', command=Requests_remove) -bt_d = Button(root, text='django删除', command=django_remove) -bt_fh = Button(root, text='返回', command=fh) +bt_r = Button(frame, text='requests删除', command=Requests) +bt_d = Button(frame, text='django删除', command=django) +bt_fastapi = Button(frame, text='fastAPI删除', command=fastAPI) +bt_sanic = Button(frame, text='sanic删除', command=sanic) +bt_nameko = Button(frame, text='namekos删除', command=nameko) +bt_pydantic = Button(frame, text='pydantic删除', command=pydantic) +bt_fh = Button(frame, text='pydantic删除', command=fh) -#pack and Label +# pack and Label Label(root, text='web类删除').pack() bt_d.pack() bt_r.pack() +bt_fastapi.pack() +bt_sanic.pack() +bt_nameko.pack() +bt_pydantic.pack() bt_fh.pack() + # mainloop root.title('web') -root.geometry('150x150+400+800') +root.geometry('200x230+100+30') root.mainloop() \ No newline at end of file diff --git a/web_delete2.pyw b/web_delete2.pyw deleted file mode 100644 index 420b779..0000000 --- a/web_delete2.pyw +++ /dev/null @@ -1,86 +0,0 @@ -from tkinter import * -from tkinter import messagebox -import os - -# 定义内容和创建主窗口 -root = Tk() -ml = os.getcwd() -ok2 = '安装成功' -uninstall = 'pip uninstall' -file_error = '文件丢失,请重新安装' - - -# 创建滚动区域的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 open_exe(exe_name): - if os.path.exists(os.path.join(ml, f"{exe_name}.exe")): - os.system(f"start {exe_name}.exe") - else: - messagebox.showerror('delete', file_error) - pass -def Requests(): - os.system('pip uninstall Requests') - messagebox.showinfo('pip uninstall', ok2) - pass -def django(): - os.system('pip uninstall django') - messagebox.showinfo(uninstall, ok2) - pass -def fastAPI(): - os.system('pip uninstall fastapi') - messagebox.showinfo(uninstall, ok2) -def sanic(): - os.system('pip uninstall sanic') - messagebox.showinfo(uninstall, ok2) -def nameko(): - os.system('pip uninstall nameko') - messagebox.showinfo(uninstall, ok2) -def pydantic(): - os.system('pip uninstall pydantic') - messagebox.showinfo(uninstall, ok2) -def fh(): - root.destroy() - pass - - -# Button -bt_r = Button(frame, text='requests删除', command=Requests) -bt_d = Button(frame, text='django删除', command=django) -bt_fastapi = Button(frame, text='fastAPI删除', command=fastAPI) -bt_sanic = Button(frame, text='sanic删除', command=sanic) -bt_nameko = Button(frame, text='namekos删除', command=nameko) -bt_pydantic = Button(frame, text='pydantic删除', command=pydantic) -bt_fh = Button(frame, text='pydantic删除', command=fh) - -# pack and Label -Label(root, text='web类删除').pack() -bt_d.pack() -bt_r.pack() -bt_fastapi.pack() -bt_sanic.pack() -bt_nameko.pack() -bt_pydantic.pack() -bt_fh.pack() - - -# mainloop -root.title('web') -root.geometry('200x230+100+30') -root.mainloop() \ No newline at end of file diff --git a/web_install.pyw b/web_install.pyw index fcc789b..487fbf1 100644 --- a/web_install.pyw +++ b/web_install.pyw @@ -2,21 +2,39 @@ from tkinter import * from tkinter import messagebox import os - +# 定义内容和创建主窗口 root = Tk() ml = os.getcwd() -ok = '安装完成!' +ok = '安装成功' +install = 'pip install' file_error = '文件丢失,请重新安装' -install_1 = 'pip install' +# 创建滚动区域的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 Requests(): os.system('pip install Requests') messagebox.showinfo('pip install', ok) pass def django(): os.system('pip install django') - messagebox.showinfo(install_1, ok) + messagebox.showinfo(install, ok) pass def open_exe(exe_name): if os.path.exists(os.path.join(ml, f"{exe_name}.exe")): @@ -25,24 +43,46 @@ def open_exe(exe_name): messagebox.showerror('install', file_error) pass pass +def fastAPI(): + os.system('pip install fastapi') + messagebox.showinfo(install, ok) +def sanic(): + os.system('pip install sanic') + messagebox.showinfo(install, ok) +def nameko(): + os.system('pip install nameko') + messagebox.showinfo(install, ok) +def pydantic(): + os.system('pip install pydantic') + messagebox.showinfo(install, ok) def fh(): root.destroy() -# button -bt_d = Button(root, text='django安装', command=django) -bt_r = Button(root, text='Requests安装', command=Requests) -bt_fh = Button(root, text='返回', command=fh) +# Button +bt_d = Button(frame, text='django安装', command=django) +bt_r = Button(frame, text='Requests安装', command=Requests) +bt_fastapi = Button(frame, text='fastAPI删除', command=fastAPI) +bt_sanic = Button(frame, text='sanic删除', command=sanic) +bt_nameko = Button(frame, text='namekos删除', command=nameko) +bt_pydantic = Button(frame, text='pydantic删除', command=pydantic) +bt_fh = Button(frame, text='返回', command=fh) - -# pack and Label +# pack Label(root, text='web类安装').pack() bt_d.pack() bt_r.pack() +bt_d.pack() +bt_r.pack() +bt_fastapi.pack() +bt_sanic.pack() +bt_nameko.pack() +bt_pydantic.pack() +bt_fh.pack() bt_fh.pack() # mainloop root.title('web') -root.geometry('150x150') +root.geometry('200x250+600+400') root.mainloop() \ No newline at end of file diff --git a/web_install2.pyw b/web_install2.pyw deleted file mode 100644 index 487fbf1..0000000 --- a/web_install2.pyw +++ /dev/null @@ -1,88 +0,0 @@ -from tkinter import * -from tkinter import messagebox -import os - -# 定义内容和创建主窗口 -root = Tk() -ml = os.getcwd() -ok = '安装成功' -install = 'pip install' -file_error = '文件丢失,请重新安装' - - -# 创建滚动区域的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 Requests(): - os.system('pip install Requests') - messagebox.showinfo('pip install', ok) - pass -def django(): - os.system('pip install django') - messagebox.showinfo(install, ok) - pass -def open_exe(exe_name): - 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 fastAPI(): - os.system('pip install fastapi') - messagebox.showinfo(install, ok) -def sanic(): - os.system('pip install sanic') - messagebox.showinfo(install, ok) -def nameko(): - os.system('pip install nameko') - messagebox.showinfo(install, ok) -def pydantic(): - os.system('pip install pydantic') - messagebox.showinfo(install, ok) -def fh(): - root.destroy() - - -# Button -bt_d = Button(frame, text='django安装', command=django) -bt_r = Button(frame, text='Requests安装', command=Requests) -bt_fastapi = Button(frame, text='fastAPI删除', command=fastAPI) -bt_sanic = Button(frame, text='sanic删除', command=sanic) -bt_nameko = Button(frame, text='namekos删除', command=nameko) -bt_pydantic = Button(frame, text='pydantic删除', command=pydantic) -bt_fh = Button(frame, text='返回', command=fh) - -# pack -Label(root, text='web类安装').pack() -bt_d.pack() -bt_r.pack() -bt_d.pack() -bt_r.pack() -bt_fastapi.pack() -bt_sanic.pack() -bt_nameko.pack() -bt_pydantic.pack() -bt_fh.pack() -bt_fh.pack() - - -# mainloop -root.title('web') -root.geometry('200x250+600+400') -root.mainloop() \ No newline at end of file diff --git a/没有使用/web_delete.pyw b/没有使用/web_delete.pyw new file mode 100644 index 0000000..4aab77e --- /dev/null +++ b/没有使用/web_delete.pyw @@ -0,0 +1,46 @@ +from tkinter import * +from tkinter import messagebox +import os + + +root = Tk() +ml = os.getcwd() +file_error = '文件丢失,请重新安装' +ok2 = '删除完成' +uninstall = 'pip uninstall' + + +def open_exe(exe_name): + if os.path.exists(os.path.join(ml, f"{exe_name}.exe")): + os.system(f"start {exe_name}.exe") + else: + messagebox.showerror('delete', file_error) + pass +def Requests_remove(): + os.system('pip uninstall Requests') + messagebox.showinfo('pip uninstall', ok2) + pass +def django_remove(): + os.system('pip uninstall django') + messagebox.showinfo(uninstall, ok2) + pass +def fh(): + root.destroy() + pass + + +# Button +bt_r = Button(root, text='Requests删除', command=Requests_remove) +bt_d = Button(root, text='django删除', command=django_remove) +bt_fh = Button(root, text='返回', command=fh) + +#pack and Label +Label(root, text='web类删除').pack() +bt_d.pack() +bt_r.pack() +bt_fh.pack() + +# mainloop +root.title('web') +root.geometry('150x150+400+800') +root.mainloop() \ No newline at end of file diff --git a/没有使用/web_install.pyw b/没有使用/web_install.pyw new file mode 100644 index 0000000..fcc789b --- /dev/null +++ b/没有使用/web_install.pyw @@ -0,0 +1,48 @@ +from tkinter import * +from tkinter import messagebox +import os + + +root = Tk() +ml = os.getcwd() +ok = '安装完成!' +file_error = '文件丢失,请重新安装' +install_1 = 'pip install' + + +def Requests(): + os.system('pip install Requests') + messagebox.showinfo('pip install', ok) + pass +def django(): + os.system('pip install django') + messagebox.showinfo(install_1, ok) + pass +def open_exe(exe_name): + 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 fh(): + root.destroy() + + +# button +bt_d = Button(root, text='django安装', command=django) +bt_r = Button(root, text='Requests安装', command=Requests) +bt_fh = Button(root, text='返回', command=fh) + + +# pack and Label +Label(root, text='web类安装').pack() +bt_d.pack() +bt_r.pack() +bt_fh.pack() + + +# mainloop +root.title('web') +root.geometry('150x150') +root.mainloop() \ No newline at end of file