pip helper
This commit is contained in:
41
GUI_delete.pyw
Normal file
41
GUI_delete.pyw
Normal file
@@ -0,0 +1,41 @@
|
||||
from tkinter import *
|
||||
from tkinter import messagebox
|
||||
import os
|
||||
|
||||
|
||||
root = Tk()
|
||||
ml = os.getcwd()
|
||||
file_error = '文件丢失!请重新安装'
|
||||
ok2 = "删除完成"
|
||||
|
||||
|
||||
def pyqt_remove():
|
||||
os.system('pip uninstall pyqt5')
|
||||
os.systen('pip uninstall PyQtWebEngine')
|
||||
messagebox.showinfo('pip uninstall', ok2)
|
||||
pass
|
||||
def wxpython_remove():
|
||||
os.system('pip uninstall wxpython')
|
||||
messagebox.showinfo('pip uninstall', ok2)
|
||||
pass
|
||||
def pygame_remove():
|
||||
os.system('pip uninstall pygame')
|
||||
messagebox.showinfo('pip uninstall', ok2)
|
||||
pass
|
||||
|
||||
# button
|
||||
bt_pq5 = Button(root, text='pyqt5删除', command=pyqt_remove)
|
||||
bt_pygame = Button(root, text='pygame删除', command=pygame_remove)
|
||||
bt_wxpython = Button(root, text='wxpython删除', command=wxpython_remove)
|
||||
|
||||
# pack and Label
|
||||
Label(root, text='GUI删除').pack()
|
||||
bt_pq5.pack()
|
||||
bt_pygame.pack()
|
||||
bt_wxpython.pack()
|
||||
|
||||
|
||||
# mainloop
|
||||
root.title('GUI')
|
||||
root.geometry('200x200+400+500')
|
||||
root.mainloop()
|
||||
15
delete.py
15
delete.py
@@ -14,23 +14,10 @@ def pyinstaller_remove():
|
||||
os.system('pip uninstall pyinstaller')
|
||||
messagebox.showinfo('pip uninstall', ok2)
|
||||
pass
|
||||
def pygame_remove():
|
||||
os.system('pip uninstall pygame')
|
||||
messagebox.showinfo('pip uninstall', ok2)
|
||||
pass
|
||||
def wxpython_remove():
|
||||
os.system('pip uninstall wxpython')
|
||||
messagebox.showinfo('pip uninstall', ok2)
|
||||
pass
|
||||
def Requests_remove():
|
||||
os.system('pip uninstall Requests')
|
||||
messagebox.showinfo('pip uninstall', ok2)
|
||||
pass
|
||||
def pyqt_remove():
|
||||
os.system('pip uninstall pyqt5')
|
||||
os.systen('pip uninstall PyQtWebEngine')
|
||||
messagebox.showinfo('pip uninstall', ok2)
|
||||
pass
|
||||
def tqdm_remove():
|
||||
os.system('pip uninstall tqdm')
|
||||
messagebox.showinfo('pip uninstall', ok2)
|
||||
@@ -56,7 +43,7 @@ remove_pyqt = Button(root, text='pyqt删除', command=pyqt_remove).pack()
|
||||
remove_pygame = Button(root, text='pygame删除',command=pygame_remove).pack()
|
||||
remove_wxpython = Button(root, text='wxpython删除', command=wxpython_remove).pack()
|
||||
remove_Requests = Button(root, text='Requests删除', command=Requests_remove).pack()
|
||||
remove_pyinstaller = Button(root, text='pyinstaller安装', command=pyinstaller_remove).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()
|
||||
remove_pywin32 = Button(root, text='pywin32删除', command=pywin32_remove).pack()
|
||||
|
||||
@@ -22,10 +22,6 @@ def pyinstaller():
|
||||
os.system('pip install pyinstaller')
|
||||
messagebox.showinfo('pip install', ok)
|
||||
pass
|
||||
def Requests():
|
||||
os.system('pip install Requests')
|
||||
messagebox.showinfo('pip install', ok)
|
||||
pass
|
||||
def nuitka():
|
||||
os.system('pip install nuitka')
|
||||
messagebox.showinfo('pip install', ok)
|
||||
@@ -38,21 +34,15 @@ def tqdm():
|
||||
os.system('pip install tqdm')
|
||||
messagebox.showinfo(install_1, ok)
|
||||
pass
|
||||
def django():
|
||||
os.system('pip install django')
|
||||
messagebox.showinfo(install_1, ok)
|
||||
pass
|
||||
def numpy():
|
||||
os.system('pip install numpy')
|
||||
messagebox.showinfo(install_1, ok)
|
||||
pass
|
||||
# 按钮
|
||||
pip_pyinstaller = Button(root, text='pyinstall安装', command=pyinstaller).pack()
|
||||
pip_Requests = Button(root, text='Requests安装', command=Requests).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()
|
||||
pip_django = Button(root, text="django安装", command=django)
|
||||
pip_numpy = Button(root, text='numpy安装', command=numpy)
|
||||
|
||||
|
||||
49
jc.py
49
jc.py
@@ -1,49 +0,0 @@
|
||||
import os
|
||||
import webbrowser
|
||||
from time import sleep
|
||||
|
||||
|
||||
error = 0
|
||||
ok = 0
|
||||
ml = os.getcwd()
|
||||
|
||||
|
||||
def jc(exe_name):
|
||||
if os.path.exists(os.path.join(ml,f"{exe_name}.exe")):
|
||||
ok += 1
|
||||
else:
|
||||
error += 1
|
||||
pass
|
||||
pass
|
||||
|
||||
def client():
|
||||
jc("client")
|
||||
|
||||
def install():
|
||||
jc("install")
|
||||
|
||||
def delete():
|
||||
jc("delete")
|
||||
|
||||
def gk():
|
||||
jc("gk")
|
||||
|
||||
def update():
|
||||
jc("update")
|
||||
|
||||
|
||||
# mainloop
|
||||
client()
|
||||
install()
|
||||
delete()
|
||||
gk()
|
||||
update()
|
||||
|
||||
sleep(0.555)
|
||||
|
||||
print(f"共有{ok}个文件正常,有{error}个文件丢失!")
|
||||
sleep(1)
|
||||
webbrowser.open("https://github.com/dengrb1/pip-helper")
|
||||
|
||||
sleep(5)
|
||||
exit()
|
||||
@@ -15,7 +15,9 @@ la_2 = Label(update, text='''1.0 程序制作完成
|
||||
1.6 加入关于模块
|
||||
1.7 新增一个小彩蛋
|
||||
1.8 新增nuitka安装和删除
|
||||
1.9 新增django库安装和删除''').pack()
|
||||
1.9 新增django库安装和删除
|
||||
2.0 修改窗口参数''').pack()
|
||||
la_3 = Label(update, text='当前版本:2.0 (Not beta verison)')
|
||||
|
||||
# 定义按钮
|
||||
def quit_update():
|
||||
@@ -26,5 +28,5 @@ quit_window_bt = Button(update, text='返回', command=quit_update)
|
||||
|
||||
# 初始化程序
|
||||
update.title('更新日志')
|
||||
update.geometry('250x250+50+50')
|
||||
update.geometry('330x250+50+50')
|
||||
update.mainloop()
|
||||
46
web_delete.pyw
Normal file
46
web_delete.pyw
Normal 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()
|
||||
44
web_install.pyw
Normal file
44
web_install.pyw
Normal file
@@ -0,0 +1,44 @@
|
||||
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
|
||||
|
||||
|
||||
# button
|
||||
bt_d = Button(root, text='django安装', command=django)
|
||||
bt_r = Button(root, text='Requests安装', command=Requests)
|
||||
|
||||
|
||||
# pack and Label
|
||||
Label(root, text='web类安装').pack()
|
||||
bt_d.pack()
|
||||
bt_r.pack()
|
||||
|
||||
|
||||
# mainloop
|
||||
root.title('web')
|
||||
root.geometry('150x150')
|
||||
root.mainloop()
|
||||
Reference in New Issue
Block a user