-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
62 lines (51 loc) · 1.63 KB
/
main.py
File metadata and controls
62 lines (51 loc) · 1.63 KB
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
61
62
import time
import asyncio
from win11toast import toast
import winsound
import os
from playsound3 import playsound
def empty_func(args):
pass
file_path = os.path.join(os.path.dirname(__file__), 'blink.mp3')
def blinkwithnotif (intv):
playsound(file_path)
toast('Blink', on_dismissed=empty_func, audio={'silent': 'true'}, on_click="Don't touch this toast notification")
print(f"Blink please (Now: {time.ctime(time.time())})")
time.sleep(intv * 60)
blinkwithnotif(intv)
def blinkwithoutnotif (intv):
playsound(file_path)
print(f"Blink please (Now: {time.ctime(time.time())})")
time.sleep(intv * 60)
blinkwithoutnotif(intv)
def choiceMin():
intv = input("Enter interval (in minutes): ")
if intv.isnumeric():
return int(intv)
else:
print("Your symbol isn't digit")
choiceMin()
def choiceNot(intv):
choice = input("Do you want notifications? (Y/N): ")
if choice.isnumeric() != True:
if choice == "Y" or choice == "N" or choice == "n" or choice == "y":
if choice == "Y" or choice == "y":
blinkwithnotif(intv)
if choice == "N" or choice == "n":
blinkwithoutnotif(intv)
else:
print("Your symbol isn't right\n")
choiceNot(intv)
else:
print("Your symbol isn't right\n")
choiceNot(intv)
def main():
print('Welcome to Blink Reminder!\n')
intv = choiceMin()
print(f'We will reminder you to blink every ' + str(intv) + " minutes!\n")
choiceNot(intv)
try:
main()
input()
except KeyboardInterrupt:
print("\nWork was stopped. Goodbye)")