Advertisement
Domy131097

Untitled

Dec 5th, 2018
107
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def ucitajbodove():
  2. dat = open('bodovi.pkl', 'rb')
  3. bodovi = pickle.load(dat)
  4. dat.close()
  5. return bodovi
  6.  
  7. def spremibodove(bodovi):
  8. dat = open('bodovi.pkl', 'wb')
  9. pickle.dump(bodovi[:10], dat)
  10. dat.close()
  11.  
  12. def mojibodovi():
  13. global ime
  14. global osvojenibodovi
  15. bodovi = []
  16.  
  17. bodovi = ucitajbodove()
  18. bodovi.append((osvojenibodovi, ime))
  19. sortirano = sorted(bodovi, reverse=True)
  20. spremibodove(sortirano)
Advertisement
RAW Paste Data Copied
Advertisement