Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #109890
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | dieter <dieter@handshake.de> |
| Newsgroups | comp.lang.python |
| Subject | Re: loading trees... |
| Date | Mon, 13 Jun 2016 09:06:24 +0200 |
| Lines | 22 |
| Message-ID | <mailman.29.1465801593.2288.python-list@python.org> (permalink) |
| References | <njkb7r$9na$1@gioia.aioe.org> <87fush1sb3.fsf@handshake.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| X-Trace | news.uni-berlin.de meq+63C2vq1Ny+2XL/KkewZ/wLFT874VKM9SDv18smxg== |
| Cancel-Lock | sha1:bE5ClkZINIHcoRo7sNSwAdgAp+U= |
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.004 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'dynamically': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'trees': 0.09; 'python': 0.10; 'code?': 0.16; 'nodes': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'received:t-ipconnect.de': 0.16; 'creates': 0.18; 'bit': 0.23; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; '(e.g.': 0.27; 'possibility': 0.27; 'directly,': 0.29; 'loads': 0.29; 'allows': 0.30; 'creating': 0.30; 'code': 0.30; 'run': 0.33; 'point': 0.33; 'problem': 0.33; 'file': 0.34; 'this?': 0.34; 'something': 0.35; 'item': 0.35; 'but': 0.36; '(and': 0.36; 'loaded': 0.36; 'structures': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'charset:us-ascii': 0.37; 'hi,': 0.38; 'data': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'received:de': 0.40; 'save': 0.60; 'today.': 0.67; 'dict()': 0.84 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| X-Gmane-NNTP-Posting-Host | p57b397fd.dip0.t-ipconnect.de |
| User-Agent | Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux) |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.22 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| X-Mailman-Original-Message-ID | <87fush1sb3.fsf@handshake.de> |
| X-Mailman-Original-References | <njkb7r$9na$1@gioia.aioe.org> |
| Xref | csiph.com comp.lang.python:109890 |
Show key headers only | View raw
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