title: Remove repeated words in a file with python
body: <p>I have a text file with multiple words repeated.
  I need every word to appear only once.</p>
  
  <p><strong>follow the code I'm trying to develop</strong></p>
  
  <pre><code>import  codecs
  
   wordList = codecs.open('Arquivo.txt' , 'r')
   wordList2 = codecs.open('Arquivo2.txt', 'w')
  
  for x in range(len(wordList)) :
      for y in range(x + 1, len(wordList ) ):
          if wordList[x] == wordList[y]:
              wordList2.append(wordList[x] )
          for y in wordList2:
              wordList.remove(y)
  </code></pre>
  
  <p><strong>Erro</strong></p>
  
  <pre><code>    wordList2 = codecs.open('File2.txt', 'w').readline()
  IOError: File not open for reading
  </code></pre>