This repository has been archived on 2025-12-22. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
QWeatherReporter/QWeather.py

45 lines
1.3 KiB
Python
Raw Normal View History

2021-12-16 21:00:04 +08:00
#!/usr/bin/env python3
# -- coding:utf-8 --
# @Author: markushammered@gmail.com
# @Development Tool: PyCharm
# @Create Time: 2021/12/16
2021-12-16 22:25:21 +08:00
# @File Name: QWeather.py
2022-01-14 18:30:11 +08:00
import threading
2021-12-16 22:25:21 +08:00
from core import qweather
2022-01-14 18:30:11 +08:00
from tkinter import messagebox
from lib.buildGUIClass import tk
from lib.buildGUIClass import root
from lib.buildGUIClass import Features
def on_closing():
if messagebox.askokcancel('Exit', 'Confirm exit?'):
Features().quit_()
2021-12-18 21:39:48 +08:00
2021-12-16 22:25:21 +08:00
if __name__ == '__main__':
2022-01-14 18:30:11 +08:00
b1 = tk.Button(root,
text='Click to run QWeather',
command=threading.Thread(target=qweather.main, name='main').start)
b1.place(x=45, y=300)
b2 = tk.Button(root,
text='Exit the main program',
command=on_closing)
b2.place(x=275, y=300)
l1 = tk.Label(root,
text='更多功能敬请期待\nEnjoy this ~',)
l1.place(x=530, y=70)
information = """
已知问题:
1.开启QWeather主程序后退出只会退出界面主程序并不会退出
2.webservice.py 的输出并不会被插入到GUI界面里
* 更多问题待发现...
"""
l2 = tk.Label(root,
text=information)
l2.place(x=140, y=350)
root.protocol('WM_DELETE_WINDOW', on_closing)
root.mainloop()