title: TypeError: expected a character buffer object when doing open()
body: <p>So I'm learning Python. I was doing a simple thing with arrays and open(), and sometimes this code works, and sometimes it doesn't! Please help!</p>
  
  <pre><code>    print('Load? (Y/N)')
  load = raw_input()
  if load == "y":
      fin = open("myArr.bat", "r")
      myArr = fin.readline()
  if load == "n":
      myArr = [0, 0, 0,
               0, 0, 0,
               0, 0, 0]
  if load != "y" and load != "n":
      print 'WUT?'
      exit()
  
  print (myArr[0]) ,  '|' ,  (myArr[1]) ,  '|' ,  (myArr [2])
  print '----------'
  print (myArr[3]) ,  '|' ,  (myArr[4]) ,  '|' ,  (myArr [5])
  print '----------'
  print (myArr[6]) ,  '|' ,  (myArr[7]) ,  '|' ,  (myArr [8])
  print '_______________________________________________'
  print 'What shall I change?'
  print 'Number in array: '
  foo = raw_input()
  doo = int(float(foo))
  print 'Number to change to: '
  bar = raw_input()
  dar = int(float(bar))
  myArr[doo] = dar
  print '_______________________________________________'
  print (myArr[0]) ,  '|' ,  (myArr[1]) ,  '|' ,  (myArr [2])
  print '----------'
  print (myArr[3]) ,  '|' ,  (myArr[4]) ,  '|' ,  (myArr [5])
  print '----------'
  print (myArr[6]) ,  '|' ,  (myArr[7]) ,  '|' ,  (myArr [8])
  fout = open("myArr.bat", "w")
  fout.write(myArr)
  fout.close()
  </code></pre>
  
  <p>Its giving me this :</p>
  
  <pre><code>   Traceback (most recent call last):
    File "Screen.py", line 35, in &lt;module&gt;
      fout.write(myArr)
  TypeError: expected a character buffer object
  </code></pre>
  
  <p>Please help!</p>