On Jun 7, 10:56 am, David Bear <[EMAIL PROTECTED]> wrote:
> I would like to write some code that would randomly select a function from a
> list of functions and call it. I was looking in the globals names space and
> randomly selecting items that were of type function..

Careful!!! You don't want to destroy your computer by accident.

> but I didn't see a
> way of actually running the function.

What do you mean? foo is a function; here's how you run it:

foo()

> Any pointers?

Given a list of functions, it would simply be, given the list of
functions bar (untested):

import random
random.choice(bar)()

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to