How to output a complex List object to a file.

Philip Semanchuk philip at semanchuk.com
Mon Jun 22 15:23:04 CEST 2009


On Jun 22, 2009, at 9:17 AM, Jim Qiu wrote:

> Hi all,
>
> I have a object list list this:
>
> from bots.botsconfig import *
> from D96Arecords import recorddefs
> from edifactsyntax3 import syntax
>
> structure=    [
> {ID:'UNH',MIN:1,MAX:1,LEVEL:[
> {ID:'BGM',MIN:1,MAX:1},
> {ID:'DTM',MIN:1,MAX:5},

...snip...

>
> {ID:'UNT',MIN:1,MAX:1},
> ]
> }
> ]
>
> I need to output this "structure" object into a file, how to do that ?

Have you looked at the pickle module?






More information about the Python-list mailing list