with open(filename, 'wb') as handle:
    pickle.dump(dict2save, handle, protocol=pickle.HIGHEST_PROTOCOL)