0
I need help with this(python)
>>> open("Test.txt", "r") Traceback (most recent call last): File "<stdin>", line 1, in <module> FileNotFoundError: [Errno 2] No such file or directory: 'Test.txt' I have no Idea what it means and what do I do... because I HAVE the file it's there!
5 Answers
0
If you are using SoloLearnâs environment it will not work since, it is a remote terminal.
If you are using your local install then you should figure out what directory it is running from or do a direct path.
Error means that it cannot find that file.
0
Itâs local. If I find the path what do I do with it?
0
In Linux you would start from home in windows it would be c:\...\...\file
Hence the command should be:
open(âc:\....\...\fileâ,ârâ)
Where ... represents the full path to the file. Or you can use relative path.
Similar to html local images.
e.g. if the file was 2 dir down it would be something like:
./dir1/dir2/file
But if it was 2 dir up and one down:
./../../dir/file
0
Ty
0
You don't need to mention file path. Place the file in same folder where you have script. Or you can go with above mentioned steps



