extract to dictionaries

Gary Herron gherron at islandtraining.com
Thu May 28 20:09:21 EDT 2009


Marius Retegan wrote:
> Hello
> I have simple text file that I have to parse. It looks something like
> this:
>
> parameters1
>      key1 value1
>      key2 value2
> end
>
> parameters2
>      key1 value1
>      key2 value2
> end
>
> So I want to create two dictionaries parameters1={key1:value1,
> key2:value2} and the same for parameters2.
>
> I woud appreciate any help that could help me solve this.
> Thank you
>   

This looks like a homework problem.   But even if it's not, you are not 
likely to find someone who is willing to put more work into this problem 
than you have. 

So  why don't you show us what you've tried, and see if someone is 
willing to make suggestions or answer specific question about your 
attempt at a solution?

Gary Herron



More information about the Python-list mailing list