with open("demofile.txt", "w") as f:
f.write("Woops! I have deleted the content!")
#open and read the file after the overwriting:
with open("demofile.txt") as f:
print(f.read())