title: Writing to a file doesn't work. When using the function read() it gives no output
body: <pre><code>import random, time, pickle #Imports needed libaries
  from random import * #Imports all from random
  
  filename = ("char.txt")
  charList = []#Sets blank list
  charListstr = ''.join(charList)#Makes new list a string so it can be written to file
  
  def write():
          creation()
          charw = open(filename, 'w')
          charw.write(charListstr)
          charw.close()
  
  
  def read():
          charr = open(filename, 'r')
          lines = charr.read()
          charr.close()
  
  
  def creation():
          charListinput = input("What would you like your charcater to be called?")
          charList.append(charListinput)
  </code></pre>
  
  <p>I am trying to get a program to accept a charcaters name and then append that data to a list. I then need the list to write to a .txt file so that it can be read externally by the user. But when the function is ran there are no erros but read() just gives a blank output. I am terrible at Python so any help would be useful.</p>