title: Python/Docker : FileNotFoundError: [Errno 2] No such file or directory:
body: <p>I am using a Python code to open a text file and write some information and close it. When I run this code on Jupyter notebook it runs perfectly but when I run this as a part of Docker container it gives the following error.</p>
  
  <p>Current directory is C:/app where I have stored Dockerfile, testfile.txt and Hello1.py. In addition I have gone to Virtual Machine and have added C: as shared folder.</p>
  
  <p>Python File</p>
  
  <pre><code>  file = open("C:/Python/testfile.txt","w")
    file.write("Hello World")
    file.write("This is our new text file")
    file.close()
  </code></pre>
  
  <p>Docker File</p>
  
  <pre><code> FROM python:latest
   WORKDIR /data
   COPY testfile.txt /data
   COPY Hello1.py /data
   CMD ["python","Hello1.py"]
  </code></pre>
  
  <p>Error Recieved</p>
  
  <pre><code> $ docker run sid1980
   Traceback (most recent call last):
   File "Hello1.py", line 7, in &lt;module&gt;
   file = open("C:/Python/testfile.txt","w")
   FileNotFoundError: [Errno 2] No such file or directory: 'C:/Python/testfile.txt'
  </code></pre>