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
> 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
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
>
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
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