Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. def setFile():
  2.  
  3. # Create file if it does not exist
  4. openingFile = open('talents.txt', 'a')
  5. openingFile.close()
  6.  
  7. # Read file
  8. openingFile = open('talents.txt', 'r')
  9. read = openingFile.read()
  10.  
  11. # Check for nothing
  12. if read == '':
  13. openingFile.close()
  14. openingFile = open('talents.txt', 'w')
  15. openingFile.write("100")
  16.  
  17. # Check for 0
  18. if read == '0':
  19. openingFile.close()
  20. openingFile = open('talents.txt', 'w')
  21. openingFile.write("100")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement