Python try finally 示例 Python Try finally 语句 Python 异常参数 Python try finally 示例 #!/usr/bin/python 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" Python Try finally 语句 Python 异常参数