On 7 , 19:56, 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.. but I didn't see a > way of actually running the function. > > Any pointers? > > -- > David Bear > -- let me buy your intellectual property, I want to own your thoughts --
if you have a list of functions you can try this: import random import math m[int(math.floor(len(m)*random.random()))]() # seems like Lisp code :D where m - is list of functions. but what about functions arguments? Strange task.. Very strange... -- http://mail.python.org/mailman/listinfo/python-list