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
Post a Comment