title: Open file in a relative location in Python
body: <p>Suppose my python code is executed a directory called <code>main</code> and the application needs to access <code>main/2091/data.txt</code>.</p>
  <p>how should I use <code>open(location)</code>? what should the parameter <code>location</code> be?</p>
  <p>I found that below simple code will work.. does it have any disadvantages?</p>
  <pre><code>file = &quot;\2091\sample.txt&quot;
  path = os.getcwd()+file
  fp = open(path, 'r+');
  </code></pre>