In my code, I have a line to open a text file from a directory. When I was using jupyter notebook in Windows 10, it works perfectly.
a = open('C:\\users\\pym\\Desktop\\test\\Data.txt', 'r')
I decided to switch running my codes in Linux.
I created a directory on my host machine using mkdir ~/notebooks
then, I used docker run -p 8888:8888 -v ~/notebooks:/home/jovyan jupyter/minimal-notebook
to mount the directory to the docker container directory. now everything that I do in jupyter notebook saves on that directory.
But when I try to open this file, I get the following error
FileNotFoundError: [Errno 2] No such file or directory: '/home/pym/notebooks/test/Data.txt'
I have used the following line to read the file, and I tested that with slash, backslash, double backslash,..., but no success.
a = open('/home/pym/notebooks/test/Data.txt', 'r')
a = open('\home\pym\notebooks\test\Data.txt', 'r')
a = open('\\home\\pym\\notebooks\\test\\Data.txt', 'r')
anyone knows what is the solution?