Python3 Write 权限 Python3 Try Else 语句 Python3 Finally 语句 Python3 Write 权限 #!/usr/bin/python3 try: fh = open("testfile", "r") fh.write("This is my test file for exception handling!!") except IOError: print ("Error: can\'t find file or read data") else: print ("Written content in the file successfully") Python3 Try Else 语句 Python3 Finally 语句