Get your
own Python
server
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#The try block will raise an error when trying to write to a read-only file: try: f = open("demofile.txt") try: f.write("Lorum Ipsum") except: print("Something went wrong when writing to the file") finally: f.close() except: print("Something went wrong when opening the file")
Something went wrong when writing to the file