[Tutor] associating two objects without ORM and processing a text file

Dave Angel davea at davea.name
Thu Feb 14 21:30:43 CET 2013


On 02/14/2013 12:35 PM, Prasad, Ramit wrote:
> neubyr wrote:
>> I am not sure how to save an object in memory to a file before exiting the program. Any examples or
>> related documentation links would be really helpful. I am guessing it would be using some kind of
>> before teardown method, but not sure about it. Any help?
>
> Look at the pickle or shelve modules.
> http://www.doughellmann.com/PyMOTW/pickle/index.html
> http://www.doughellmann.com/PyMOTW/shelve/index.html
>

You miss the point.  The OP wants to make sure the text file is saved no 
matter how the program happens to exit.  He's not asking how to format 
the file.



-- 
DaveA


More information about the Tutor mailing list