Python program when hitting Ctrl + C?
I'm trying this sort of thing, but it barfing out a lot of errors to the screen
if __name__ == '__main__':
try:
main_loop()
except KeyboardInterrupt:
print >> sys.stderr, '\nExiting..\n'
sys.exit(0)
what did you think print >> sys.stder do
not sure, it was a legacy Python 2 script I inherited
Обсуждают сегодня