Reputation: 3
I get: FileNotFoundError: [Errno 2] No such file or directory:'movies.txt' for this line:
with open("movies.txt", "r", encoding= "utf-8") as movies:
So far (from what I've tried) I'm figuring it's a VSC workspace/file nesting depth issue...maybe some settings I don't know exist somewhere.
Is there a way to fix this? Should I stop using nested files? How many levels of nested files are okay? (I'm 3 levels down from my main workspace folder) New to coding and VSC (using desktop version) so not sure what's good practice for organising files.
Some stuff I've checked/tried:
Upvotes: 0
Views: 41
Reputation: 74
import os
print(os.getcwd())
Check your current working directory or you can specify full path to the file like below :
with open("/full/path/to/your/movies.txt", "r", encoding="utf-8") as movies:
# code
Upvotes: 0