Skip to content

Instantly share code, notes, and snippets.

@mudream4869
Created February 10, 2022 15:39
Show Gist options
  • Save mudream4869/7d7756346034f841cd4b3fa13ed29ce2 to your computer and use it in GitHub Desktop.
Save mudream4869/7d7756346034f841cd4b3fa13ed29ce2 to your computer and use it in GitHub Desktop.
python-event-sleep.py
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