title: Python: Create associative array in a loop
body: <p>I want to create an associative array with values read from a file. My code looks something like this, but its giving me an error saying i can't the indicies must be ints.</p>
  
  <p>Thanks =]</p>
  
  <pre><code>for line in open(file):
    x=prog.match(line)
    myarray[x.group(1)]=[x.group(2)]
  </code></pre>