Help understanding code
elbertlev at hotmail.com
elbertlev at hotmail.com
Sun Apr 10 09:02:37 EDT 2005
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!
More information about the Python-list
mailing list