Opening a file creates it and (unless append (‘a’) is set) overwrites it with emptyness, such as this:
open(filename, 'w').close()
Opening a file creates it and (unless append (‘a’) is set) overwrites it with emptyness, such as this:
open(filename, 'w').close()