+ signal.signal(signal.SIGINT, func)
+
+def killed_handler(signal, frame):
+ reason = ""
+ sys.stdout.write("\n# Reason for killing program? ")
+ reason = sys.stdin.readline().strip("\r\n ")
+ for out in aquire["open_files"]:
+ sys.stdout.write("# Closing file " + str(out) + "\n")
+ out.write("# Recieved KILL signal.\n# Reason: " + str(reason))
+ log_close(out)