views:

47

answers:

2

Hello,

I'm wondering if there is a tool similar to dir() for modules that will tell me what parameters a given function takes.

For instance, I would like to do something like dir(os.rename) and have it tell me what the parameters are documented as so that I can avoid checking the documentation online, and instead use only the python scripting interface to do this.

If I've misused any terms in the title please let me know so I can update it.

Thanks!

+3  A: 

help(thing) pretty prints all the docstrings that are in the module, method, whatever ...

nate c
Exactly what I was looking for, thank you!
gnucom
+2  A: 

I realize that you're more interested in help(thing) or thing.__doc__, but if you're trying to do programmatic introspection (instead of human-readable documentation) to find out about calling a function, then you can use the inspect module, as discussed in this question.

Josh Kelley
Very interesting, thank you.
gnucom