Python3 Try Finally 实例 Python3 通过索引迭代 Python3 单个异常 Python3 Try Finally 实例 #!/usr/bin/python3 try: fh = open("testfile", "w") try: fh.write("This is my test file for exception handling!!") finally: print ("Going to close the file") fh.close() except IOError: print ("Error: can\'t find file or read data") Python3 通过索引迭代 Python3 单个异常