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 :::: >> Complete Web Services >> http://www.datafly.net >> >> > Like this: > > info_I_need = 'name' > > print getattr(person, info_I_need) > > Related to getattr are setattr and hasattr. > Gary Herron > > > > :::: DataFly.Net :::: Complete Web Services http://www.datafly.net -- http://mail.python.org/mailman/listinfo/python-list