Re: [Tutor] Use iterator to refer to an object's attribute?

2006-04-21 Thread Ron Britton
Alan Thanks for the thorough reply. > Hi Ron, I'm confused and may be missing something but it > sounds to me like a classic tree structure that you are trying > to build for each module. It seems like a tree to me. > I''m not sure why you put filling the database into a separate > function rat

Re: [Tutor] Use iterator to refer to an object's attribute?

2006-04-20 Thread Ron Britton
>> I wanted to make the methods flexible enough that I wouldn't have to >> edit every method if the module list ever changed. I guess I don't >> understand how a dictionary works in this situation. > > I don;t understand what you don;t understand here. Can you expand on > why you don't think a

[Tutor] Use iterator to refer to an object's attribute?

2006-04-20 Thread Ron Britton
Short version: How do I use an iterator to refer to an object's attribute? E.g., "z" is a list of attributes of "b": for x, y in z: for a in b.x.y Also, any suggestions for my overall structure below? -- Long version: I need to make a program to send commands to an instrument. I