[Tutor] names and variables

Kent Johnson kent37 at tds.net
Wed Aug 20 14:19:15 CEST 2008


On Wed, Aug 20, 2008 at 5:37 AM, Marc Tompkins <marc.tompkins at gmail.com> wrote:

> print(getattr(myObject, "colour"))

Or, of course,
print getattr(myObject, myAttribute) which is what the OP wanted.

Kent


More information about the Tutor mailing list