[Tutor] (no subject)

Johan Kohler kohlerj at ukzn.ac.za
Sun Feb 13 13:18:27 CET 2005

I still have problems pickling and unpickling.  After I couldn't get
"complicated" objects to work, i decided to use simple lists.  But now
there seems to be a difference between assigning a list value, and using
the .append method.  Please try out the code at
http://goose.cs.und.ac.za/python/save1.py     There are two "use cases" 
 WorkingCase() and BrokenCase.  

WorkingCase() saves data in a list using assignment, and by appending,
and then reads it back from the file.  BrokenCase performs only the
reading back step.   Now, there are no problems when the two cases are
run consecutively.  Do this once.  Then comment out the WorkingCase()
statement, and run only BrokenCase().  This should read back all the
list entries, but all the ones created by "appending" are blank!  I
should mention, that in my application I want to append items one by one
to the list.

Please can someone help me with this?  I am getting extremely frustrated
by not being able to get supposedly simple stuff to work.

Thanks in advance,

More information about the Tutor mailing list