Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import sys
  2.  
  3. fileEncoding = "UTF-8"
  4. apu = ""
  5. data = []
  6. charsSet = set()
  7. with open(sys.argv[1], "r", encoding=fileEncoding) as infile:
  8. for line in infile:
  9. for char in line:
  10. if char not in charsSet and char != " ":
  11. apu = apu + char
  12. charsSet.add(char)
  13.  
  14. with open(sys.argv[2], "w", encoding=fileEncoding) as outfile:
  15. print(" ".join(apu.rstrip()), file=outfile)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement