Created
July 10, 2020 07:22
-
-
Save simryang/5497cbfc9520100f2a0178475ebdf6a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
while True: | |
pass | |
time.sleep(1) | |
except (KeyboardInterrupt, SystemExit): | |
pass | |
finally: | |
if s_th_enable: | |
s_th.stop() | |
logging.info('Good bye!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It runs endless loop with 'while True:'.
When Ctrl + C is pressed or process received SystemExit signal, it runs part of code 'finally'