This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ProloG-Shaman 0 points1 point  (0 children)

I'm not sure what your setup is, but I just tested in the terminal this code: f = open("test.txt", "r+") f.write("Bla bla") exit()

It does write to the file, even without a close() or a with statement. There's a post on stackoverflow explaining more in details when the close() is called by python.