title: Update a text file with ( new words+ \n ) after the words is appended into a list
body: <p>I  have this problem and I am looking forward to see your positive answers and  solutions. 
  the codes bellow: when the program detects misspelled words after the text split
  it append each misspelled word into a list [a]
  and now my problem is that how can I write(update) to  dictionary with the misspelled words in a way that each line in the dictionary contains only one word. so far I  have tried  and it only writes the current insert and deletes the previous records.  any help is appreciated ( THANKS) </p>
  
  <pre><code>  def onaddbutton(self,event):
      os.chdir('d:/KKSC')
      dic = getDic()
      print dic[0], dic[1], dic[2]
      text = tokenize_editor_text(self.controlz.GetValue())     
      a = []
      for word in text:
          if word not in dic:
              misspelled = word
              a.append(misspelled)
              f= (misspelled)
              with open('test.text', encoding='utf-8', mode='w') as f:
              f.write(misspelled)
              f.write('\n')
              f.seek(0)
              print(repr(f.readline()[:1]))
  </code></pre>