Changed bad if statements that were using 'is' and made '==' instead.

This commit is contained in:
MikeTheWatchGuy 2019-06-26 11:09:42 -04:00
parent 23dfb5f7cc
commit ad100b8e75
22 changed files with 45 additions and 52 deletions

View file

@ -8,13 +8,13 @@ import time
"""
Timer Desktop Widget Creates a floating timer that is always on top of other windows You move it by grabbing anywhere on the window Good example of how to do a non-blocking, polling program using SimpleGUI Can be used to poll hardware when running on a Pi
While the timer ticks are being generated by PySimpleGUI's "timeout" mechanism, the actual value
of the timer that is displayed comes from the system timer, time.time(). This guarantees an
accurate time value is displayed regardless of the accuracy of the PySimpleGUI timer tick. If
this design were not used, then the time value displayed would slowly drift by the amount of time
it takes to execute the PySimpleGUI read and update calls (not good!)
it takes to execute the PySimpleGUI read and update calls (not good!)
NOTE - you will get a warning message printed when you exit using exit button.
It will look something like: invalid command name \"1616802625480StopMove\"
"""
@ -46,9 +46,9 @@ while (True):
if event == 'button':
event = window.FindElement(event).GetText()
# --------- Do Button Operations --------
if event is None or event == 'Exit': # ALWAYS give a way out of program
if event in (None, 'Exit'): # ALWAYS give a way out of program
break
if event is 'Reset':
if event == 'Reset':
start_time = int(round(time.time() * 100))
current_time = 0
paused_time = start_time