need an alternative to getattr()

Ant antroy at gmail.com
Mon Aug 7 12:25:20 EDT 2006


>     getattr(heading, "process")(file_ptr)
...
> Is there an alternatice to getattr() that will solve my problem, or is
> there another way to do it.

How about:

eval("%s.process(%s)" % (heading, file_ptr))




More information about the Python-list mailing list