title: Import vs open for input file
body: <p>I have an input file with variables that I would like to use in a python program. Is it better to bring in the variables using import:</p>
  
  <pre><code>import imp
  inputData = imp.load_source(...)
  </code></pre>
  
  <p>Or is it better to read the file using:</p>
  
  <pre><code>for line in open('inputfile'):
  </code></pre>
  
  <p>Are there advantages or disadvantages either way?</p>
  
  <p>Thanks in advance!</p>