pip-helper/update.py

37 lines
1022 B
Python
Raw Normal View History

2023-04-07 23:17:25 +08:00
from tkinter import *
from tkinter import messagebox
2023-05-04 17:30:35 +08:00
import webbrowser
2023-05-05 12:18:46 +08:00
from tkinter.scrolledtext import ScrolledText
2023-04-07 23:17:25 +08:00
update = Tk()
2023-05-04 17:38:12 +08:00
url_update = 'https://kgithub.com/dengrb1/pip-helper/releases'
2023-04-07 23:17:25 +08:00
la_1 = Label(update, text='更新日志').pack()
2023-05-05 12:18:46 +08:00
text = """0.1.0 version is beta and demo version
当前版本:0.1.0"""
text_box = ScrolledText(root)
text_box.pack(fill=BOTH, expand=1)
text_box.insert(END, text)
text_box.configure(state='disabled')
2023-04-07 23:17:25 +08:00
# 定义按钮
2023-05-04 17:30:35 +08:00
def update_now():
webbrowser.open(url_update)
2023-05-04 17:38:12 +08:00
messagebox.showinfo('update', '请选择最新版本并下载运行安装程序,然后就可以更新了!')
2023-05-04 17:30:35 +08:00
pass
2023-04-07 23:17:25 +08:00
def quit_update():
update.destroy()
pass
# 按钮设置
2023-05-05 12:18:46 +08:00
update_now_bt = Button(update, text='更新到最新版本', command=update_now).pack(side=RIGHT)
quit_window_bt = Button(update, text='返回', command=quit_update).pack(side=RIGHT)
2023-05-04 17:38:12 +08:00
2023-04-07 23:17:25 +08:00
# 初始化程序
update.title('更新日志')
2023-05-03 00:32:10 +00:00
update.geometry('330x250+50+50')
2023-04-07 23:17:25 +08:00
update.mainloop()