Append to a pickle file without deleting

Viewed 8641

I've tried to write to a file using binary mode with the pickle module. This is an example:

    import pickle
    file = open("file.txt","wb")
    dict = {"a":"b","c":"d"}
    pickle.dump(dict, file)
    file.close()

But this method deletes the other dicts written before. How can I write without deleting the other things in the file?

2 Answers
Related