title: Python Array is read-only, can't append values
body: <p>I am new to Python.  The following code is causing an error when it attempts to append values to an array.  What am I doing wrong?</p>
  
  <pre><code>import re
  from array import array
  
  freq_pattern = re.compile("Frequency of Incident[\(\)A-Za-z\s]*\.*\s*([\.0-9]*)")
  col_pattern = re.compile("([-\.0-9]+)\s+([-\.0-9]+)\s+([-\.0-9]+)\s+([-\.0-9]+)\s+([-\.0-9]+)")
  e_rcs = array('f')
  
  f = open('example.4.out', 'r')
  
  for line in f:
      print line,
  
      result = freq_pattern.search(line)
      if result:
          freq = float(result.group(1))
  
      cols = col_pattern.search(line)
      if cols:
          e_rcs.append = float(cols.group(2))
  
  f.close()
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <blockquote>
    <p>Traceback (most recent call last):<br>
    File "D:\workspace\CATS
    Parser\cats-post.py", line 31, in
    
        e_rcs.append = float(cols.group(2)) AttributeError:
    'list' object attribute 'append' is
    read-only attributes (assign to .append)</p>
  </blockquote>