data file auto-parsing

Hilbert hilbert at microsoft.com
Thu Mar 6 08:21:53 CET 2003


Hello,

Is there a parser that would convert python-like
indented data files into data structures? Like:

#--------------
numbers
    1
    4
    5
colors
    light
        red
        green
    dark
        blue
#--------------

Would be parsed into a list like:

[    ['numbers',['1','4','5']],
     ['colors',['light',['red','green']],
                  ['dark',['blue']] ] ]

Am I crazy?
Thanks,
Hilbert







More information about the Python-list mailing list