I was successful in testing pickle with multiple objects both READ & WRITE. <br><br>I did WRITE as -<br>---<br>#!/usr/bin/python<br><br>import pickle<br><br>class apple_Class(object):<br>    def __init__(self, **kwds):<br>
        self.__dict__.update(kwds)<br>myInst = apple_Class()<br>myInst.FirstString = "Apple"<br>myInst.SecondString = "Orange"<br><br>with open('/tmp/readfile.pkl', 'wb') as f:<br>    pickle.dump((myInst.FirstString, myInst.SecondString), f)<br>
----<br><br>I did READ as -<br><br>---<br>#!/usr/bin/python<br><br>import pickle<br><br>class apple_Class(object):<br>    def __init__(self, **kwds):<br>        self.__dict__.update(kwds)<br><br>myInst = apple_Class()<br>
with open('/tmp/readfile.pkl', 'rb') as f:<br>    myInst.FirstString, myInst.SecondString = pickle.load(f)<br><br>print myInst.FirstString<br>print myInst.SecondString<br>---<br><br>Both worked successfully.<br>
<br>Now, I have to write a file having below three things -<br><br>- Having dictionary of many instances<br>- string as a Key<br>- Instances as Value.<br><br>Finally, I have to do the same thing as above to WRITE in separate file and READ in separate file.<br>
<br>So, the issues is simply how to handle many instances in a dictionary with Key and Value.<br>