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 signal | |
from sys import stdin, stdout | |
import time | |
def clean_exit(): | |
# do whatever is required to clean up, then | |
exit() | |
if __name__ == "__main__": | |
signal.signal(signal.SIGINT, clean_exit) |