title: An integer is required? open()
body: <p>I have a very simple python script that <strong>should</strong> scan a text file, which contains lines formatted as <em>id</em>='<em>value</em>' and put them into a dict. the python module is called chval.py and the input file is in.txt. here's the code:</p>
  
  <pre><code>import os,sys
  from os import *
  from sys import *
  
  vals = {}
  
  f = open(sys.argv[1], 'r')
  
  for line in val_f:
      t = line.split('=')
      t[1].strip('\'')
      vals.append(t[0], t[1])
  
  print vals
  
  f.close()
  </code></pre>
  
  <p>when i try to run it i get:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):<br>
    File "chval.py", line 9, in ?
        f = open(sys.argv[1], 'r') TypeError: an integer is required</p>
  </blockquote>
  
  <p>I'm using python 2.4... because i've been challenged to not use anything newer, is there something about open() that I don't know about? Why does it want an integer?</p>
  
  <p>anything after that line is untested. in short: why is it giving me the error and how do i fix it?</p>