Python: Append dictionary in another file -


i working on program , need access dicionary file, know how do.i need able append same dictionary , have saved in current form other file.

is there anyway this?

edit:

the program requires log in. can create account, , when needs save username:password entered dictionary. way had it, create account, once quit program, account deleted.

you can store , retrieve data structures using pickle module in python, provides object serialisation.

save dictionary

import pickle some_dict = {'this':1,'is':2,'an':3,'example':4}  open('saved_dict.pkl','w') pickle_out:     pickle.dump(some_dict,pickle_out) 

load dictionary

with open('saved_dict.pkl.'r') pickle_in:     that_dict_again = pickle.load(pickle_in) 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -