Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. a = 0
  2. b = "|"
  3. while a < 100000:
  4. a += 1 # Same as a = a + 1
  5. new = (a,b)
  6. f = open("export.txt","a") #opens file with name of "export.txt"
  7. f.write(str(new))
  8. f.close()
  9.  
  10.  
  11. infile = "export.txt"
  12. outfile = "newfile.txt"
  13.  
  14. delete_list = ["(","," "'"]
  15. fin = open(infile)
  16. fout = open(outfile, "w+")
  17. for line in fin:
  18. for word in delete_list:
  19. line = line.replace(word, "")
  20. fout.write(line)
  21. fin.close()
  22. fout.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement