I've written a script to open, read, and then close a text file, but I keep getting an error message saying it can't find the file I specify.
I've massively reduced the code but I still get the same error message.
The code:
txt = open("textf.txt", "r")
print(txt.read())
txt.close()
The error message from running the code:
Traceback (most recent call last):
File "C:\Users\miles\AppData\Local\Programs\Python\Python36-32\openfiles.py", line 1, in <module>
txt = open("textf.txt", "r")
FileNotFoundError: [Errno 2] No such file or directory: 'textf.txt'