File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change 44from tkinter .constants import BOTTOM , FLAT , LEFT
55from tkinter .font import BOLD
66import threading
7- import winsound
7+ import os
88
9- ctypes .windll .shcore .SetProcessDpiAwareness (True )
9+ try :
10+ import winsound
11+ ctypes .windll .shcore .SetProcessDpiAwareness (True )
12+ except Exception :
13+ pass
1014
1115root = Tk ()
1216root .config (bg = "Salmon" )
@@ -68,17 +72,24 @@ def start_timer(options, cycle_limit=5):
6872 root .update_idletasks ()
6973 time .sleep (1 )
7074 temp_work -= 1
71- winsound .Beep (323 , 250 )
72- winsound .Beep (583 , 250 )
75+ try :
76+ winsound .Beep (323 , 250 )
77+ winsound .Beep (583 , 250 )
78+ except Exception :
79+ os .system ('tput bel' )
80+
7381 while temp_break :
7482 title_label .config (text = "You should be taking a break now." )
7583 minutes , seconds = divmod (temp_break , 60 )
7684 timer_label .config (text = f"{ minutes } :{ seconds } " )
7785 root .update_idletasks ()
7886 time .sleep (1 )
7987 temp_break -= 1
80- winsound .Beep (523 , 250 )
81- winsound .Beep (783 , 250 )
88+ try :
89+ winsound .Beep (523 , 250 )
90+ winsound .Beep (783 , 250 )
91+ except Exception :
92+ os .system ('tput bel' )
8293 cycles += 1
8394
8495 reset ()
You can’t perform that action at this time.
0 commit comments