+ 4
Where can i find a list of functions available under each module?
6 Respostas
+ 6
I think you can just help("module") for a doc dump of the applicable module.
>>> help("math")
...or just a method:
>>> help("math.trunc")
math.trunc = trunc(...) ... Truncates x to the nearest ...
+ 4
You could use the 'inspect' module. See also http://stackoverflow.com/questions/139180/listing-all-functions-in-a-JUMP_LINK__&&__python__&&__JUMP_LINK-module
+ 2
listing all functions and all classes with dir(module)
+ 2
With credit to @Bart Genuit, here's a post for getting at docstrings with effects:
help(my_func) - typical
my_func.__doc__ - unprocessed docstring
inspect.getdoc(obj) - normalizes tabs / removes common spaces using cleandoc, and will retrieve docs from the object hierarchy (parents) if not set at children.
+ 1
python.org has documentation for all modules in the standard lib
+ 1
@Haydar Tekeli
dir() "attempts to produce the most relevant, rather than complete, information"
http://docs.python.org/library/functions.html#dir
For modules this is a list of attributes.