dictionary of lists of dictionaries in python

Posted by Andy on Stack Overflow See other posts from Stack Overflow or by Andy
Published on 2014-08-21T22:11:22Z Indexed on 2014/08/21 22:20 UTC
Read the original article Hit count: 381

Filed under:
|
|

I'm a perl scripter working in python and need to know a way to do the following perl in python.

$Hash{$key1}[$index_value]{$key2} = $value;

I have seen the stackoverflow question here: List of dictionaries, in a dictionary - in Python

I still don't understand what self.rules is doing or if it works for my solution.

My data will be coming from files, and will I will be using regexes to capture to temporary variables until ready to store in the data structure. If you need to ask, the order related to the $index_value is important and would like to be maintained as an integer.

Any suggestions are appreciated or if you think I need to rethink data structures with Python that would be helpful.

© Stack Overflow or respective owner

Related posts about python

Related posts about perl