call function based on string value python code example Example: python call function by string getattr(obj, 'func')('foo', 'bar', 'args')