Print an error message without printing a traceback and close the program when a condition is not met
You can turn off the traceback by limiting its depth. Python 2.x import sys sys.tracebacklimit = 0 Python 3.x In Python 3.5.2 and 3.6.1, setting tracebacklimit to 0 does not seem to have the intended effect. This is a known bug. Note that -1 doesn’t work either. Setting it to None does however seem to … Read more