From: Garcia, M. <mgarcia@Businessedge.com> - 2001-03-13 16:01:29
|
Since you are using Jython can I suggest using Java serialization? It is a little more verbose that shelve but is fairly straightforward. This is not an answer to your original question but an alternative. Mick -----Original Message----- From: John Hethcox To: jyt...@li... Sent: 3/13/01 12:53 AM Subject: [Jython-users] whichdb indeed! All, The following script runs in python, but not jython: import shelve subd = { "hula":"hoop", "sevenof":9 } d = shelve.open( "dictfile" ) d["hoop"] = "skirt" d["polo"] = "pony" d["subber"] = subd d.close() d = shelve.open( "dictfile" ) print d["subber"] This is the output from the jython run: jython.bat shelvetest.py Traceback (innermost last): File "shelvetest.py", line 4, in ? File "e:\Jython\Lib\shelve.py", line 157, in open File "e:\Jython\Lib\shelve.py", line 147, in __init__ File "e:\Jython\Lib\anydbm.py", line 71, in open ImportError: no module named whichdb whichdb.py is not in the the jython distribution so I borrowed the one from python. That eventually led to other problems (which I omit here). What is the best strategy for getting shelve to work? Thanks (again) John <<Card for John Hethcox>> |