Re: Accessing function in a module by name

2007-06-06 Thread John Nagle
Tobiah wrote: > Is there a way to call function in an imported > module having only the name? ... > I'm trying to set up a function dispatcher for a > SOAP server. Bad idea. This exposes all the functions of the module to calls from the outside world. Big security hole. In any case, SOA

Re: Accessing function in a module by name

2007-06-06 Thread Tobiah
> What's wrong with real_func = getattr(foo, func_name) ? Maybe I > misunderstood your question ? Nothing, it just didn't exist in my mind until now. Thanks -- Posted via a free Usenet account from http://www.teranews.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing function in a module by name

2007-06-06 Thread John Machin
On Jun 7, 8:13 am, Tobiah <[EMAIL PROTECTED]> wrote: > Is there a way to call function in an imported > module having only the name? > > func_name = 'doit' > > real_func = foo.some_magic(func_name) Presuming 'foo' is the name of the module: real_func = getattr(foo, func_name) > > #Now call it >

Re: Accessing function in a module by name

2007-06-06 Thread imho
Tobiah ha scritto: > Is there a way to call function in an imported > module having only the name? > > > func_name = 'doit' > > real_func = foo.some_magic(func_name) > > #Now call it > real_func(args) > > > I'm trying to set up a function dispatcher for a > SOAP server. > > Thanks, > > Tobi

Accessing function in a module by name

2007-06-06 Thread Tobiah
Is there a way to call function in an imported module having only the name? func_name = 'doit' real_func = foo.some_magic(func_name) #Now call it real_func(args) I'm trying to set up a function dispatcher for a SOAP server. Thanks, Tobiah -- Posted via a free Usenet account from http://ww