Skip to content

Instantly share code, notes, and snippets.

@Demonstrandum
Created September 28, 2017 11:09
Show Gist options
  • Save Demonstrandum/0ea22a2be2f1b5ff06eb4a79099262ad to your computer and use it in GitHub Desktop.
Save Demonstrandum/0ea22a2be2f1b5ff06eb4a79099262ad to your computer and use it in GitHub Desktop.
area_trainer.py
import cPickle as pickle
import time, sys, random
def save_users(file, dic):
# Save users
with open(file, 'wb') as file:
pickle.dump(dic, file)
data_file = 'login_data.p'
login_data = {}
# Create file to store login_data in pickle
open(data_file, 'a').close()
save_users(data_file, login_data)
# Load database of ussers
with open('login_data.p', 'r') as file:
login_data = pickle.load(file)
# Save any users added
save_users(data_file, login_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment