title: How to open file in python when file is stored in directory where all .py file is stored and how to open file when it stored in different directory
body: <p>I'm new at learning python and i don't know which default directory python use to open file. </p>
  
  <p>I have read some of the similar question answer on stackoverflow but didn't helped me. I'm running python 3.6.2.</p>
  
  <p>I have following code where 'test.txt' file is stored where all .py files stored but i'm getting</p>
  
  <blockquote>
    <p>FileNotFoundError: [Errono 2] No such file or directory: 'test.txt'</p>
  </blockquote>
  
  <pre><code>handle = open('test.txt')
  for line in handle:
     print(line)
  </code></pre>