Shelve and classes
Curtis Jensen
cjensen at bioeng.ucsd.edu
Tue Aug 8 17:34:16 EDT 2000
I have several data classes (only contain array data). I want to use
shelve to save this data to a database. I tried and this is what I got:
>>> import shelve
>>> d = shelve.open('tmp.db')
>>> d['nodes'] = nodes
Traceback (innermost last):
File "<stdin>", line 1, in ?
File "/usr/local/Python/lib/python1.5/shelve.py", line 71, in
__setitem__
self.dict[key] = f.getvalue()
dbm.error: Cannot add item to database
>>>
nodes was already declared as an instance of one of my classes. What am
I doing wrong? Thanks.
--
Curtis Jensen
cjensen at bioeng.ucsd.edu
http://www-bioeng.ucsd.edu/~cjensen/
FAX (425) 740-1451
More information about the Python-list
mailing list