Re: How to use dynamic properties? -- Noob

2007-01-24 Thread Sean Schertell
Yep, that was it. Thanks Gary :-) Sean On Jan 23, 2007, at 5:05 PM, Gary Herron wrote: Sean Schertell wrote: person.name = 'Joe' person.age = 20 person.sex = 'm' info_I_need = name print person.info_I_need # How can I make it print 'Joe' ? Sean DataFly.Net

How to use dynamic properties? -- Noob

2007-01-23 Thread Sean Schertell
person.name = 'Joe' person.age = 20 person.sex = 'm' info_I_need = name print person.info_I_need # How can I make it print 'Joe' ? Sean DataFly.Net Complete Web Services http://www.datafly.net -- http://mail.python.org/mailman/listinfo/python-list

Re: How to use dynamic properties? -- Noob

2007-01-23 Thread Gary Herron
Sean Schertell wrote: person.name = 'Joe' person.age = 20 person.sex = 'm' info_I_need = name print person.info_I_need # How can I make it print 'Joe' ? Sean DataFly.Net Complete Web Services http://www.datafly.net Like this: info_I_need = 'name' print

Re: How to use dynamic properties? -- Noob

2007-01-23 Thread Bruno Desthuilliers
Sean Schertell a écrit : person.name = 'Joe' person.age = 20 person.sex = 'm' info_I_need = name print person.info_I_need # How can I make it print 'Joe' ? print getattr(person, name) -- http://mail.python.org/mailman/listinfo/python-list