Fillmore <fillmore_rem...@hotmail.com> writes: > Hi, problem for today. I have a batch file that creates "trees of data". > I can save these trees in the form of python code or serialize them with > something > like pickle. > > I then need to run a program that loads the whole forest in the form of a > dict() > where each item will point to a dynamically loaded tree. > > What's my best way to achieve this? Pickle? or creating curtom python code?
Not sure about the "best". But one possibility would be to use the "ZODB" ("Zope Object DataBase"). The "ZODB" allows you to store rooted graph like data structures (among them forests) persitently. Nodes in this graph are loaded dynamically (and cached). It would be a bit difficult to use Python "dict"s directly, but the ZODB comes with "dict" like data structures which play well with the ZODB persistency (e.g. "BTrees.OOBTree"). -- https://mail.python.org/mailman/listinfo/python-list