Created
September 28, 2017 11:09
-
-
Save Demonstrandum/0ea22a2be2f1b5ff06eb4a79099262ad to your computer and use it in GitHub Desktop.
area_trainer.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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