title: Opening and reading files in Python not working
body: <p>I am trying to build a program that reads a value from a separate text file. In this case, it is named "Test.lang". It contains the text "Hello World".</p>
  
  <p>My program was working just fine with: </p>
  
  <hr>
  
  <pre><code>from sys import *
  
  def open_file(filename):
  print (filename)
  
  def run():
      data = open_file(argv[1])
  
  run()
  </code></pre>
  
  <p>Then, when I tried to change it to: </p>
  
  <pre><code>from sys import *
  
  def open_file(filename):
     data = open(filename, "r").read()
     print (data)
  
  def run():
     data = open_file(argv[1])
  
  run()
  </code></pre>
  
  <p>It does not work. I get 4 errors: </p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\John\Desktop\Senior Project\basic.py
  ", line 10, in &lt;module&gt;
      run()
    File "C:\Users\John\Desktop\Senior Project\basic.py
  ", line 8, in run
      data = open_file(argv[1])
    File "C:\Users\John\Desktop\Senior Project\basic.py
  ", line 4, in open_file
      data = open(filename, 'r')
  FileNotFoundError: [Errno 2] No such file or directory: 'test.lang'
  </code></pre>
  
  <p>What is really confusing me is the last one. How did the previous program work, but now test.lang doesn't exist?
  Please help me.﻿</p>