title: passing string to file open function in python
body: <p>I have a user input and I want to pass it as the file name parameter of the open function.  This is what I have tried:</p>
  
  <pre><code>filename = input("Enter the name of the file of grades: ")
  file = open(filename, "r")
  </code></pre>
  
  <p>When the user input is <code>openMe.py</code> an error arises,</p>
  
  <pre><code>NameError: name 'openMe' is not defined
  </code></pre>
  
  <p>but when the user inputs <code>"openMe.py</code>" it works fine.  I am confused as to why this is the case because I thought the filename variable is a string.  Any help would be appreciated, thanks.</p>