Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. def unique_file(input_filename, output_filename):
  2.  
  3. input_file = open(input_filename, "r")
  4. contents = input_file.read()
  5. input_file.close()
  6.  
  7. new_list = []
  8. words = contents.split()
  9. for word in words:
  10. if word not in words:
  11. new_list = new_list + (word + "\n")
  12. return new_list
  13.  
  14.  
  15. output_file = open(output_filename, "w")
  16. output_file.write(new_list)
  17. output_file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement