pip helper
This commit is contained in:
@@ -8,6 +8,7 @@ ml = os.getcwd()
|
||||
file_error = '文件丢失,请重新安装'
|
||||
install = 'pip install'
|
||||
ok = '安装成功!'
|
||||
i = '-i https://mirrors.aliyun.com/pypi/simple/'
|
||||
|
||||
|
||||
# 创建滚动区域的Canvas对象
|
||||
@@ -28,8 +29,45 @@ 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('pip helper', file_error)
|
||||
pass
|
||||
def Numpy():
|
||||
os.system('pip install numpy -i https://mirrors.aliyun.com/pypi/simple/')
|
||||
messagebox.showinfo(install, ok)
|
||||
def scipy():
|
||||
pass
|
||||
os.system(f'pip install scipy {i}')
|
||||
messagebox.showinfo(install, ok)
|
||||
def sympy():
|
||||
os.system(f'pip install sympy {i}')
|
||||
messagebox.showinfo(install, ok)
|
||||
def pandas():
|
||||
os.system(f'pip install pandas {i}')
|
||||
messagebox.showinfo(install, ok)
|
||||
def fh():
|
||||
root.destroy()
|
||||
|
||||
|
||||
# Button
|
||||
bt_n = Button(frame, text='Numpy安装', command=Numpy)
|
||||
bt_scipy = Button(frame, text='scipy安装', command=scipy)
|
||||
bt_sympy = Button(frame, text='sympy安装', command=sympy)
|
||||
bt_pandas = Button(frame, text='pandas安装', command=pandas)
|
||||
bt_fh = Button(frame, text='返回', command=fh)
|
||||
|
||||
# pack and Label
|
||||
Label(root, text='计算类安装')
|
||||
bt_fh.pack()
|
||||
bt_n.pack()
|
||||
bt_scipy.pack()
|
||||
bt_sympy.pack()
|
||||
bt_pandas.pack()
|
||||
|
||||
|
||||
# mainloop
|
||||
root.title('install')
|
||||
root.geometry('200x200+10+100')
|
||||
root.mainloop()
|
||||
Reference in New Issue
Block a user