[Tutor] Re: Storing dictionaries

Charlie Clark charlie@begeistert.org
Mon, 25 Mar 2002 22:43:17 +0100


On 2002-03-24 at 23:16:03 [+0100], tutor-request@python.org wrote:
> 
>    from pprint import pprint
>    fielddict_file = open("fielddict.txt","w")
>    pprint(fielddict, fielddict_file)
>    fielddict_file.close()
> 
> pprint (at least for the data I've pushed through it) produces an output 
> that is readable and also suitable to paste into a python program as 
> source code.  I've been using it to print dictionaries of database 
> information

wow, what an amazing language and what a great list.
Python provides a generic, easy to use serialisation method (Pickle) and some top-notch and still easy to use alternatives for specialised use and this list makes this information available to all in an easy to understand and informal way. I've learned so much since I joined it!!!

A big thanx to all!

Charlie