0
Error when opening a file
when I try opening a file using the right syntax, I get a FileNotFoundError which says : No such file or directory
2 Antworten
+ 3
Verify that your path is right, and if not absolute, verify that the current working directory is the one you think by adding these lines in your script:
import os
print(os.getcwd())
Anyway, if you search the path of the running script file (which is not necessarly the current working directory), you can get it by this way:
print(os.path.dirname(os.path.realpath(__file__))
+ 2
Its likely that your path to the file is incorrect