I keep on trying to read a file on the computer:
f = open("C:\Users\Yuzu\Documents\Python Datafile.txt", "w") f.write("Hello") f.close() f = ("C:\Users\Yuzu\Documents\Python Datafile.txt", "rt") print(f.read())
But it says that there is a attribute error and also says that tuple does not contain read
change
f = ("C:UsersYuzuDocumentsPython Datafile.txt", "rt")
to
f = open("C:UsersYuzuDocumentsPython Datafile.txt", "rt")
1.4m articles
1.4m replys
5 comments
57.0k users