Re: python persistence

2008-04-18 Thread castironpi
On Apr 1, 3:21 pm, [EMAIL PROTECTED] wrote: > On Apr 1, 11:34 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > > En Tue, 01 Apr 2008 08:47:33 -0300, <[EMAIL PROTECTED]> escribió: > > > > >> c['0']= type('None',(),{}) > > >> > Traceback (most recent call last): > > >> > pickle.PicklingError: Can't

Re: python persistence

2008-04-02 Thread castironpi
On Apr 1, 3:21 pm, [EMAIL PROTECTED] wrote: > On Apr 1, 11:34 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > > > > > > En Tue, 01 Apr 2008 08:47:33 -0300, <[EMAIL PROTECTED]> escribió: > > > >> c['0']= type('None',(),{}) > > >> > Traceback (most recent call last): > > >> > pickle.Pic

Re: python persistence

2008-04-01 Thread castironpi
On Apr 1, 11:34 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 01 Apr 2008 08:47:33 -0300, <[EMAIL PROTECTED]> escribió: > > >> c['0']= type('None',(),{}) > >> > Traceback (most recent call last): > >> > pickle.PicklingError: Can't pickle : it's not > >> > found as __main__.None

Re: python persistence

2008-04-01 Thread Gabriel Genellina
En Tue, 01 Apr 2008 08:47:33 -0300, <[EMAIL PROTECTED]> escribió: >> c['0']= type('None',(),{}) >> > Traceback (most recent call last): >> > pickle.PicklingError: Can't pickle : it's not >> > found as __main__.None >> >> Don't do that then. Or use the available pickle hooks to customize how  

Re: python persistence

2008-04-01 Thread castironpi
On Apr 1, 12:16 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 01 Apr 2008 00:48:35 -0300, <[EMAIL PROTECTED]> escribió: > > > We do have, but on Windows, file is not locked to multi-tasking, > > shelve.  But why don't we have types in there, or non-string > > primitives in keys? > >

Re: python persistence

2008-03-31 Thread Gabriel Genellina
En Tue, 01 Apr 2008 00:48:35 -0300, <[EMAIL PROTECTED]> escribió: > We do have, but on Windows, file is not locked to multi-tasking, > shelve. But why don't we have types in there, or non-string > primitives in keys? > c= shelve.open( 'temp', 'c' ) c['0']= 'a' c.sync() del c >

Re: python persistence

2008-03-31 Thread castironpi
On Mar 31, 7:14 pm, 7stud <[EMAIL PROTECTED]> wrote: > On Mar 31, 5:31 pm, [EMAIL PROTECTED] wrote: > > > Can you have a Python object stored entirely on disk? > > import cPickle as cp > > class Dog(object): >     def __init__(self, name): >         self.name = name > > d = Dog("Spot") > > f = open

Re: python persistence

2008-03-31 Thread castironpi
On Mar 31, 10:28 pm, [EMAIL PROTECTED] wrote: > On Mar 31, 9:27 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > > > > On Mar 31, 8:51 pm, [EMAIL PROTECTED] wrote: > > > On Mar 31, 7:14 pm, 7stud <[EMAIL PROTECTED]> wrote: > > > > > On Mar 31, 5:31 pm, [EMAIL PROTECTED] wrote: > > > > > > Can y

Re: python persistence

2008-03-31 Thread castironpi
On Mar 31, 9:27 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Mar 31, 8:51 pm, [EMAIL PROTECTED] wrote: > > On Mar 31, 7:14 pm, 7stud <[EMAIL PROTECTED]> wrote: > > > > On Mar 31, 5:31 pm, [EMAIL PROTECTED] wrote: > > > > > Can you have a Python object stored entirely on disk? > > > > import cP

Re: python persistence

2008-03-31 Thread George Sakkis
On Mar 31, 8:51 pm, [EMAIL PROTECTED] wrote: > On Mar 31, 7:14 pm, 7stud <[EMAIL PROTECTED]> wrote: > > > > > On Mar 31, 5:31 pm, [EMAIL PROTECTED] wrote: > > > > Can you have a Python object stored entirely on disk? > > > import cPickle as cp > > > class Dog(object): > > def __init__(self, nam

Re: python persistence

2008-03-31 Thread castironpi
On Mar 31, 7:14 pm, 7stud <[EMAIL PROTECTED]> wrote: > On Mar 31, 5:31 pm, [EMAIL PROTECTED] wrote: > > > Can you have a Python object stored entirely on disk? > > import cPickle as cp > > class Dog(object): >     def __init__(self, name): >         self.name = name > > d = Dog("Spot") > > f = open

Re: python persistence

2008-03-31 Thread 7stud
On Mar 31, 5:31 pm, [EMAIL PROTECTED] wrote: > Can you have a Python object stored entirely on disk? import cPickle as cp class Dog(object): def __init__(self, name): self.name = name d = Dog("Spot") f = open("data.txt", "w") cp.dump(d, f) f.close() f = open("data.txt") stored_obj