refer to: http://www.runoob.com/python/python-exceptions.html http://www.pythondoc.com/pythontutorial3/errors.html http://www.cnblogs.com/rubylouvre/archive/2011/06/22/2086644.html…
主要用到 try...except...raise...finally... 1. try...except... try: for i in range(1, 1000): print i time.sleep(1) except KeyboardInterrupt: print 'My Interruption' 2. try...except...finally...(中途不论是否有异常,finally语句都会执行) try: for i in range(1, 1000): print…