How to create a dict based on such a file?
wangcoeus at gmail.com
Mon Feb 14 00:47:55 EST 2011
I am new to python. Currently I encountered a problem, please help me to
solve this. Thanks in advance!
I have a file like below:
Different block may have different keys and even same key in different
blocks may have different values.
Now I want to get a function, which like this:
and it will return a dictionary as below:
func(key1) = [block1:value1,block2:value4,...,blockn:value7]
and if one block has no "key1" parameter, it will not include in this
Thanks a lot!
In the middle of every difficulty lies opportunity.
-- Albert Einstein
More information about the Python-list