title: reading a file in python from different directory
body: <p>Probably a simple query.. But basically, I have data in directory <code>"/foo/bar/foobar.txt"</code> </p>
  
  <p>and I am working in directory <code>"/some/path/read_foobar.py"</code>..</p>
  
  <p>Now I want to read the file "foobar.txt" but rather than giving full path, I thought of adding /foo/bar/ to the path.. </p>
  
  <p>So, added the following at the start of read_foobar.py</p>
  
  <pre><code>import sys
  sys.path.append("/foo/bar")
  </code></pre>
  
  <p>But when I try to read <code>open("foobar.txt","r")</code>, it is not able to find the file?
  how do I do this?
  Thanks</p>