title: How to get path that ipynb file is running in?
body: <p>I have a program that reads in several subfolders of files.</p>
  
  <p>I had previously written code that had :</p>
  
  <pre><code>path = 'C:/Users/Me/etc/etc/'
  </code></pre>
  
  <p>And then I would open several files by saying</p>
  
  <pre><code>file1 = path + str('file1.txt')
  </code></pre>
  
  <p>How do I change the code so that it can be used by others? I am using Jupyter notebook and so __file __ and sys(argv[0]) don't seem to be working.</p>
  
  <p>I have looked at these:</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/51520/how-to-get-an-absolute-file-path-in-python">How to get an absolute file path in Python</a></li>
  <li><a href="https://stackoverflow.com/questions/2860153/how-do-i-get-the-parent-directory-in-python">How do I get the parent directory in Python?</a> </li>
  </ol>