pip helper

This commit is contained in:
dengrb1 2023-05-10 17:36:23 +08:00 committed by GitHub
parent 936eae1054
commit fbf21c7259
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 195 additions and 195 deletions

View File

@ -2,45 +2,85 @@ from tkinter import *
from tkinter import messagebox from tkinter import messagebox
import os import os
# 定义内容和创建主窗口
root = Tk() root = Tk()
ml = os.getcwd() ml = os.getcwd()
file_error = '文件丢失,请重新安装' ok2 = '安装成功'
ok2 = '删除完成'
uninstall = 'pip uninstall' 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("<Configure>", 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): def open_exe(exe_name):
if os.path.exists(os.path.join(ml, f"{exe_name}.exe")): if os.path.exists(os.path.join(ml, f"{exe_name}.exe")):
os.system(f"start {exe_name}.exe") os.system(f"start {exe_name}.exe")
else: else:
messagebox.showerror('delete', file_error) messagebox.showerror('delete', file_error)
pass pass
def Requests_remove(): def Requests():
os.system('pip uninstall Requests') os.system('pip uninstall Requests')
messagebox.showinfo('pip uninstall', ok2) messagebox.showinfo('pip uninstall', ok2)
pass pass
def django_remove(): def django():
os.system('pip uninstall django') os.system('pip uninstall django')
messagebox.showinfo(uninstall, ok2) messagebox.showinfo(uninstall, ok2)
pass 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(): def fh():
root.destroy() root.destroy()
pass pass
# Button # Button
bt_r = Button(root, text='Requests删除', command=Requests_remove) bt_r = Button(frame, text='requests删除', command=Requests)
bt_d = Button(root, text='django删除', command=django_remove) bt_d = Button(frame, text='django删除', command=django)
bt_fh = Button(root, text='返回', command=fh) 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() Label(root, text='web类删除').pack()
bt_d.pack() bt_d.pack()
bt_r.pack() bt_r.pack()
bt_fastapi.pack()
bt_sanic.pack()
bt_nameko.pack()
bt_pydantic.pack()
bt_fh.pack() bt_fh.pack()
# mainloop # mainloop
root.title('web') root.title('web')
root.geometry('150x150+400+800') root.geometry('200x230+100+30')
root.mainloop() root.mainloop()

View File

@ -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("<Configure>", 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()

View File

@ -2,21 +2,39 @@ from tkinter import *
from tkinter import messagebox from tkinter import messagebox
import os import os
# 定义内容和创建主窗口
root = Tk() root = Tk()
ml = os.getcwd() ml = os.getcwd()
ok = '安装完成!' ok = '安装成功'
install = 'pip install'
file_error = '文件丢失,请重新安装' 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("<Configure>", 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(): def Requests():
os.system('pip install Requests') os.system('pip install Requests')
messagebox.showinfo('pip install', ok) messagebox.showinfo('pip install', ok)
pass pass
def django(): def django():
os.system('pip install django') os.system('pip install django')
messagebox.showinfo(install_1, ok) messagebox.showinfo(install, ok)
pass pass
def open_exe(exe_name): def open_exe(exe_name):
if os.path.exists(os.path.join(ml, f"{exe_name}.exe")): 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) messagebox.showerror('install', file_error)
pass pass
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(): def fh():
root.destroy() root.destroy()
# button # Button
bt_d = Button(root, text='django安装', command=django) bt_d = Button(frame, text='django安装', command=django)
bt_r = Button(root, text='Requests安装', command=Requests) bt_r = Button(frame, text='Requests安装', command=Requests)
bt_fh = Button(root, text='返回', command=fh) 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
# pack and Label
Label(root, text='web类安装').pack() Label(root, text='web类安装').pack()
bt_d.pack() bt_d.pack()
bt_r.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() bt_fh.pack()
# mainloop # mainloop
root.title('web') root.title('web')
root.geometry('150x150') root.geometry('200x250+600+400')
root.mainloop() root.mainloop()

View File

@ -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("<Configure>", 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()

View File

@ -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()

View File

@ -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()