Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #109890
| From | dieter <dieter@handshake.de> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: loading trees... |
| Date | 2016-06-13 09:06 +0200 |
| Message-ID | <mailman.29.1465801593.2288.python-list@python.org> (permalink) |
| References | <njkb7r$9na$1@gioia.aioe.org> <87fush1sb3.fsf@handshake.de> |
Fillmore <fillmore_remove@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").
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
loading trees... Fillmore <fillmore_remove@hotmail.com> - 2016-06-12 14:55 -0400 Re: loading trees... Michael Selik <michael.selik@gmail.com> - 2016-06-13 01:10 +0000 Re: loading trees... dieter <dieter@handshake.de> - 2016-06-13 09:06 +0200 Re: loading trees... Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-06-14 20:51 -0700
csiph-web