gleki at gol.ge
Wed Jan 2 23:20:40 CET 2002
Meanwhile, I found another solution:
I guess it will produce the same result?
Sylvain Thenault wrote:
> On Wed, 02 Jan 2002 13:13:44 -0800, Giorgi Lekishvili <gleki at gol.ge> wrote:
> >Hi all!
> >happy new year, first of all!!!
> >My question is simple, yet I missed the right answer, although have lots
> >of books on Python:(
> >Suppose, one has a module, which defines some set of functions.
> >The question:
> >How can one get the names of all these functions as list entries?
> >import myModule
> >of course, this will not work.
> >What is to be done? Some special functions are to be written or, is
> >there a built-in tool?
> you can use the built-in "dir" function to do things like that.
> The following code filters functions from the "dir" output:
> import myModule
> for f in dir(myModule):
> if callable(getattr(myModule, d)):
> print d
> Sylvain Thenault
> LOGILAB http://www.logilab.org
More information about the Python-list