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

Reply via email to