SyntaxFix
Write A Post
Hire A Developer
Questions
Opening a file creates it and (unless append ('a') is set) overwrites it with emptyness, such as this:
open(filename, 'w').close()