title: Python - Attribute Error '_io.TextIOWrapper' object has no attribute 'open'
body: <p>I receive an error</p>
  
  <pre><code>File.open(classname+'.txt','a')
  AttributeError: '_io.TextIOWrapper' object has no attribute 'open'
  </code></pre>
  
  <p>while trying to open a file. I need to open the file and write to the file with the scores.</p>
  
  <p>Here is the code</p>
  
  <pre><code>if Exists==False:
      File.open(classname+'.txt','a')
      File.write(name+','+surname+','+str(1)+','+str(score)+'/n')
  
  else:
      File=open(classname+'.txt','w')
      linecount=len(filelines)
      for i in range(0,linecount):
          File.write(filelines[i])
  </code></pre>