Dynamically calling functions - Python

Posted by RadiantHex on Stack Overflow See other posts from Stack Overflow or by RadiantHex
Published on 2010-05-12T11:53:08Z Indexed on 2010/05/12 12:04 UTC
Read the original article Hit count: 211

Filed under:
|

Hi folks,

I have a list of functions... e.g.

def filter_bunnies(pets): ...

def filter_turtles(pets): ...

def filter_narwhals(pets): ...

Is there a way to call these functions by using a string representing their name?

e.g.

'filter_bunnies', 'filter_turtles', 'filter_narwhals'

© Stack Overflow or respective owner

Related posts about python

Related posts about beginner