-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask_tip_hourly.py
60 lines (40 loc) · 1.31 KB
/
task_tip_hourly.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from tkinter import messagebox
import time
from datetime import datetime
def show_popup():
import tkinter as tk
popup = tk.Tk()
popup.title("工作日志提示")
popup.geometry("400x300")
# 添加文本
label = tk.Label(popup, text="现在时间是{}, 该定期在笔记里写工作总结了".format(now))
label.pack()
popup.lift()
popup.focus_force()
popup.mainloop()
def show_popup_git_sync():
import tkinter as tk
popup = tk.Tk()
popup.title("工作日志提示")
popup.geometry("400x300+600+600")
# 添加文本
label = tk.Label(popup, text="现在时间是{}, 该定期同步git仓库了".format(now))
label.pack()
popup.lift()
popup.focus_force()
popup.mainloop()
range_tip_count = 10
counter = 0
while True:
now = datetime.now()
# print("现在时间是", now.hour, now.minute)
if(now.minute > 54 and now.minute <= 59):
if( counter < range_tip_count ):
show_popup()
if(now.hour == 11 or now.hour == 15 or now.hour == 16):
show_popup_git_sync()
time.sleep(30)
counter = counter + 1
else:
counter = 0
time.sleep(60*2)