From: kj on 10 Aug 2010 08:19 I'm looking for a module that implements "persistent lists": objects that behave like lists except that all their elements are stored on disk. IOW, the equivalent of "shelves", but for lists rather than a dictionaries. Does anyone know of such a module? (I suppose that I could slap together a crude implementation of such a thing by wrapping a shelf with suitable methods to simulate the list interface. But I'd rather not roll my own if a tested implementation already exist.) TIA! ~K
From: Thomas Jollans on 12 Aug 2010 16:37 On Tuesday 10 August 2010, it occurred to kj to exclaim: > I'm looking for a module that implements "persistent lists": objects > that behave like lists except that all their elements are stored > on disk. IOW, the equivalent of "shelves", but for lists rather > than a dictionaries. > > Does anyone know of such a module? > > (I suppose that I could slap together a crude implementation of > such a thing by wrapping a shelf with suitable methods to simulate > the list interface. But I'd rather not roll my own if a tested > implementation already exist.) You could simply use pickle to save the data every once in a while.
From: Raymond Hettinger on 13 Aug 2010 17:12 On Aug 12, 1:37 pm, Thomas Jollans <tho...(a)jollybox.de> wrote: > On Tuesday 10 August 2010, it occurred to kj to exclaim: > > > I'm looking for a module that implements "persistent lists": objects > > that behave like lists except that all their elements are stored > > on disk. IOW, the equivalent of "shelves", but for lists rather > > than a dictionaries. . . . > You could simply use pickle to save the data every once in a while. That is a very reasonable solution.
|
Pages: 1 Prev: Weird Python behaviour Next: Newbie question - calculating prime numbers |