ViaThinkSoft CodeLib
This article is in:
CodeLib → Programming aids → Python
import sys
import traceback
try:
# insert code here
except (KeyboardInterrupt, SystemExit):
sys.stderr.write("Keyboard interrupt\n")
except Exception as e:
sys.stderr.write("\n")
sys.stderr.write("\n")
sys.stderr.write("** ERROR **\n")
#sys.stderr.write("Message: {}\n".format(e))
traceback.print_exc()
sys.stderr.write("\n")
Daniel Marschall
ViaThinkSoft Co-Founder
ViaThinkSoft Co-Founder