Reading the language tututorial would help you a lot :( === what is the difference between pc and pc()?
pc = getToolByName(....) - returnes a refference to a method pc is a refference to a method, pc() is a method invocation. ============ numbers = {"total":len(results),"bytype":{},"bystate":{}} <=== This is hard to understand num = numbers["bytype"].get(ctype, 0) <==== where does .get come from? and what is the string 'bytype' doing? numbers["bytype"][ctype] = num <====== is this some kind of an array? Read the tutorial especially portion about dictionaries! -- http://mail.python.org/mailman/listinfo/python-list