Created
February 10, 2022 15:39
-
-
Save mudream4869/7d7756346034f841cd4b3fa13ed29ce2 to your computer and use it in GitHub Desktop.
python-event-sleep.py
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
import threading, signal | |
exit = threading.Event() | |
def main(): | |
while not exit.is_set(): | |
exit.wait(60) | |
def quit(signo, frame): | |
exit.set() | |
if __name__ == '__main__': | |
signal.signal(signal.SIGTERM, quit) | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment