
January 15th, 2013, 01:39 PM
|
|
Registered User
|
|
Join Date: Jan 2013
Posts: 1
Time spent in forums: 21 m 31 sec
Reputation Power: 0
|
|
|
Need help writing to an external dictionary
def register(users):
unr = raw_input('Desired Username: ')
if users.has_key(unr):
print 'Sorry, username is already taken'
else:
pr = raw_input('Enter Password: ')
users[unr] = pr
from usernames import users
register(users)
I want to write the new username and password to the dictionary permanently, not just in the memory. So that the file will contain that information the next time the user tries to log in.
I know that its insecure, but it is just for practice, how to write to the dictionary and external files. any help would be awesome! 
|