Re: getattr on a function

2009-04-27 Thread Terry Reedy
Mr SZ wrote: Hi all, Is it possible to call functions using getattr. I have written a simple script with functions that call either SSL, TLS or plain functionality. something like: def func(): ... def funcSSL(): ... def funcTLS(): funcs = {'none':func, 'SSL':funcSSL, 'TLS':funcTLS} ...

Re: getattr on a function

2009-04-27 Thread John Machin
On Apr 28, 2:30 am, Mr SZ wrote: > Hi all, > > Is it possible to call functions using getattr. I have written a simple > script with functions that call either SSL, TLS or plain functionality. > > something like: > def func(): >   ... > > def funcSSL(): >   ... > > def funcTLS(): >   ... > > Now,

Re: getattr on a function

2009-04-27 Thread Peter Otten
Mr SZ wrote: > Is it possible to call functions using getattr. I have written a simple > script with functions that call either SSL, TLS or plain functionality. > > something like: > def func(): > ... > > def funcSSL(): > ... > > def funcTLS(): > ... > > Now, based on my args I would lik

getattr on a function

2009-04-27 Thread Mr SZ
Hi all, Is it possible to call functions using getattr. I have written a simple script with functions that call either SSL, TLS or plain functionality. something like: def func(): ... def funcSSL(): ... def funcTLS(): ... Now, based on my args I would like to call either one of them. I