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.
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter