Re: Questions on Pickle and Shelve

2015-11-06 Thread Peter Otten
Virgil Stokes wrote: > Here is snippet of Python (vers. 2.7.10) code that bothers me. > > import cPickle as pickle > > print "Pickle lists:" > dogs = ['Rover','King','Spot','Rufus'] > cats = ['Mimi','Misty','Sasha'] > > with open('pickle.dat', 'wb') as pfile: > pickle.dump(dogs, pfile) >

Re: Questions on Pickle and Shelve

2015-11-06 Thread Chris Warrick
On 6 November 2015 at 12:53, Virgil Stokes wrote: > Here is snippet of Python (vers. 2.7.10) code that bothers me. > > [snip bad code] > > 1) Which (the pickle or shelve code) takes less total RAM, if dogs and cats > were very large? > 2) When the last shelve.open is given, is the entire content

Questions on Pickle and Shelve

2015-11-06 Thread Virgil Stokes
Here is snippet of Python (vers. 2.7.10) code that bothers me. import cPickle as pickle print "Pickle lists:" dogs = ['Rover','King','Spot','Rufus'] cats = ['Mimi','Misty','Sasha'] with open('pickle.dat', 'wb') as pfile: pickle.dump(dogs, pfile) pickle.dump(cats,pfile) del(dogs); del(c