Is 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 parameters are documented so that I can avoid checking the documentation online, and instead use only the Python scripting interface to do this.
Asked
Active
Viewed 5,135 times
8
2 Answers
12
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.
Community
- 1
- 1
Josh Kelley
- 56,064
- 19
- 146
- 246
4
help(thing) pretty prints all the docstrings that are in the module, method, whatever ...
nate c
- 8,802
- 2
- 27
- 28