Re: Store multiple dictionaries in a file
- From: "Philipp H. Mohr" <phm4@xxxxxxxxxx>
- Date: Thu, 30 Jun 2005 12:30:06 +0100 (BST)
Thank you for you answer.
> > I would like to store multiple dictionaries in a file, if possible one per
> > line.
>
> Why "one per line" ?
I agree with you that it sounds like nasty code :-) but there is a good
reason for doing it this way - I think. My code collects data (attributes)
of its current environment, e.g. date, time, location, etc.
These values are put into a dictionary and passed to another program which
processes the data. The dictionary (or vector of attributes) is the only
interface between both progs. The one which creates the dictionary can
forget about it after it has passed it on. This is where the storing comes
into action. In order to be able to re-run an experiment I want to store
the dictionaries in a file. Also the program might not run continuasly,
therefore if I write all of them to a file, on after the other, I would be
able to re-run the experiment much easier.
Hope this makes sense.
Thank you,
Phil
>
> A pretty simple solution could be to store all the dicts in another
> container (list or dict, depending on how you need to retrieve'em, but
> from what you explain I'd say a list) and then pickle this container.
.
- References:
- Store multiple dictionaries in a file
- From: Philipp H. Mohr
- Re: Store multiple dictionaries in a file
- From: bruno modulix
- Store multiple dictionaries in a file
- Prev by Date: Re: Store multiple dictionaries in a file
- Next by Date: Re: Which kid's beginners programming - Python or Forth?
- Previous by thread: Re: Store multiple dictionaries in a file
- Next by thread: Re: Store multiple dictionaries in a file
- Index(es):
Relevant Pages
|