Re: building a dictionary dynamically

2012-02-06 Thread Terry Reedy
On 2/6/2012 11:10 AM, noydb wrote: Adding to dictionaries just isn't obvious... if it's not dict.Add or dict.Appaned or the like, not obvious to inexperienced me! Have you read section 4.8-mapping types, of the library manual? Or help(dict) at the interactive prompt? -- Terry Jan Reedy -- htt

Re: building a dictionary dynamically

2012-02-06 Thread alex23
On Feb 5, 4:13 am, noydb wrote: > How do you build a dictionary dynamically? > >>> inDict = {} > >>> for inFC in inFClist: > >>>     print inFC > >>>     inCount =  int(arcpy.GetCount_management(inFC).getOutput(0)) > > where I want to make a dictionary like {inFC: inCount, inFC: > inCount, } >

Re: building a dictionary dynamically

2012-02-06 Thread Dave Angel
On 02/04/2012 01:13 PM, noydb wrote: How do you build a dictionary dynamically? Doesn't seem to be an insert object or anything. So I need an empty dictionary that I then want to populate with values I get from looping through a list and grabbing some properties. So simply, I have (fyi, arcpy

Re: building a dictionary dynamically

2012-02-06 Thread Richard Thomas
On Feb 4, 6:13 pm, noydb wrote: > How do you build a dictionary dynamically?  Doesn't seem to be an > insert object or anything.  So I need an empty dictionary that I then > want to populate with values I get from looping through a list and > grabbing some properties.  So simply, I have (fyi, arcp