pickle.dump(dict2, fp)
pickle.dump(dict3, fp)
with open(filename, 'rb') as fp:
    d1 = pickle.load(fp)
d2 = pickle.load(fp)
d3 = pickle.load(fp)
How to cPickle dump and load separate dictionaries to the same file?