Re: how to get function names from the file

2006-02-17 Thread Luis M. González
"eval" is not necessary in this case. If you have a tuple with function names such as this: x=(printFoo, printFOO) you can execute them this way: >>> for f in x: f() -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get function names from the file

2006-02-17 Thread Magnus Lycka
Petr Jakes wrote: > I have got names of functions stored in the file. For the simplicity > expect one row only with two function names: printFoo, printFOO > In my code I would like to define functions and then to read function > names from the file, so the functions can be executed in the order the

Re: how to get function names from the file

2006-02-15 Thread Larry Bates
Petr Jakes wrote: > I have got names of functions stored in the file. For the simplicity > expect one row only with two function names: printFoo, printFOO > In my code I would like to define functions and then to read function > names from the file, so the functions can be executed in the order the

Re: how to get function names from the file

2006-02-15 Thread Terry Reedy
"Petr Jakes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have got names of functions stored in the file. For the simplicity > expect one row only with two function names: printFoo, printFOO > In my code I would like to define functions and then to read function > names from the

Re: how to get function names from the file

2006-02-15 Thread Kamilche
The following will return a dictionary containing the names and functions of all the public functions in the current module. If a function starts with an underscore _, it is considered private and not listed. def _ListFunctions(): import sys import types d = {} module = sys.modules

Re: how to get function names from the file

2006-02-15 Thread Kent Johnson
Petr Jakes wrote: > I have got names of functions stored in the file. For the simplicity > expect one row only with two function names: printFoo, printFOO > In my code I would like to define functions and then to read function > names from the file, so the functions can be executed in the order the

Re: how to get function names from the file

2006-02-15 Thread luis . armendariz
Try the following: def printFoo(): print "Foo" def printFOO(): print "FOO" functions = ("printFoo", "printFOO")# list or tuple of strings from file, or wherever for function in functions: call = function + "()" eval(call) -- http://mail.python.org/mailman/listinfo/python-li