title: execfile() in python , using it for user input
body: <p>I am trying to take in a filename from a user and then use <code>execfile()</code> to execute the file. Below is my code: </p>
  
  <pre><code>print "Please enter the name of the file"
  filename = raw_input().split(".")[0]
  module = __import__(filename)
  execfile(module)             &lt;-- this is where I want to execute the file
  </code></pre>
  
  <p>I understand that <code>execfile()</code> works as follows:</p>
  
  <pre><code>execfile("example.py")
  </code></pre>
  
  <p>I am unsure on how to do this when the filename is passed as a variable . I am using python 2.7.</p>