✍️ “w” will overwrite any existing content

PHOTO EMBED

Mon Oct 24 2022 10:26:16 GMT+0000 (Coordinated Universal Time)

Saved by @L0uJ1rky45M #python

f = open("C:\\Users\\username\\....\\demofile.txt", "w")
f.write("What if we rewrite the file? Say you were made to be mine. ")
f = open(r"C:\\Users\\username\\....\\demofile.txt")
print(f.read())

#Output
#What if we rewrite the file? Say you were made to be mine.
content_copyCOPY