[Tutor] ?????

Alan Gauld alan.gauld at btinternet.com
Mon May 25 16:06:02 CEST 2009


"prasad rao" <prasadaraon50 at gmail.com> wrote

> for x in dir(sys):
> ?? if sys.x is callable:

Even if you use the other suggestions to prove its 
callable that doesn't mean you can do this:

> ????  print sys.x()

If the callable takes parameters then this will fail.
You need to know quite a lot more about what you 
are calling and that is a non trivial task in the general case.

Alan G



More information about the Tutor mailing list