how to call function in string python code example Example: python call function by string getattr(obj, 'func')('foo', 'bar', 'args')