Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. Town 1,300,
  2. Town 2,205,
  3. Town 3,600,
  4. Town 4,910,
  5. Town 5,360,
  6.  
  7. f = open("ModifiedPotatoes.txt","w")
  8. f.close()
  9.  
  10. with open("Potatoes.txt","r") as file:
  11. for line in file:
  12. info = line.split(",")
  13. if "Town 2" or "Town 4" in line:
  14. info[1] -= 20
  15. with open("ModifiedPotatoes.txt","a"):
  16. infoStr = "n" + ",".join(str(x) for x in info)
  17. file.write(infoStr)
  18.  
  19. f = open("Potatoes.txt","w")
  20. f.close()
  21.  
  22. with open("ModifedPotatoes.txt","r") as file:
  23. for line in file:
  24. with open("Potatoes.txt","a") as potatoesFile:
  25. potatoesFile.write(line)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement