If you are going to print the exception, it is better to use print(repr(e)) ; the base Exception.__str__ implementation only returns the exception message, not ... ... <看更多>
As we'll see, Python handles runtime errors via its exception handling ... try: print("this gets executed first") except: print("this gets executed only if ... ... <看更多>