I'm not sure I completely understand what you want, but if you are
using Python2.5 defaultdict might be useful. Below is some example
code using defaultdict.


[code]
from collections import defaultdict

myvar = defaultdict(dict)

myvar["cat"]["paw"] = "SomeString"
myvar["dog"]["tail"] = "wags"
myvar["cat"]["tongue"] = "sand-paper"
myvar["mouse"]["likes"] = "cheese"
[/code]

The documentation can do a better job of explaining how this works
than I can: http://docs.python.org/lib/defaultdict-objects.html

-Matt

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to