title: Python - AttributeError: '_io.TextIOWrapper' object has no attribute 'append'
body: <p>I receive an error</p>
  
  <p><code>ClassFile.append(filelines)
  AttributeError: '_io.TextIOWrapper' object has no attribute 'append'</code></p>
  
  <p>while trying to write a file. It is about writing a file about pupil's scores, their name, lastname, classname (Just enter class as <code>Class 1</code>)a scorecount of how many scores and their scores. Only their last 3 scores are to be kept in the file. I don't understand what this means. </p>
  
  <p>Here is the code</p>
  
  <pre><code>score=3
  counter=0
  
  name=input('Name:')
  surname=input('Last Name:')
  Class=input('Class Name:')
  
  filelines=[]
  
  Class=open(Class+'.txt','r')
  line=Class.readline()
  while line!='':
      Class.append(filelines)
      Class.close()
  
  linecount=len(filelines)
  for i in range(0,linecount):
      data=filelines[i].split(',')
  </code></pre>