Exit gracefully on ctrl-c

pull/18/head
Cees Bassa 2019-07-08 15:07:26 +02:00
parent f2ba0a9ee3
commit 02b12e45f5
1 changed files with 5 additions and 1 deletions

View File

@ -19,6 +19,7 @@ import os
from termcolor import colored
import time
import shutil
import sys
if __name__ == "__main__":
# Read commandline options
@ -138,7 +139,10 @@ if __name__ == "__main__":
shutil.move(fname + ".cat", "processed")
# Sleep
time.sleep(10)
try:
time.sleep(10)
except KeyboardInterrupt:
sys.exit()
# Close files
fstat.close()