+ 4

Where can i find a list of functions available under each module?

9th Oct 2016, 2:08 PM
Alexander Perez
Alexander Perez - avatar
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 ...
9th Oct 2016, 5:52 PM
Kirk Schafer
Kirk Schafer - avatar
10th Oct 2016, 4:04 PM
Bart Genuit
Bart Genuit - avatar
+ 2
listing all functions and all classes with dir(module)
9th Oct 2016, 7:02 PM
Haydar Tekeli
Haydar Tekeli - avatar
+ 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.
10th Oct 2016, 4:28 PM
Kirk Schafer
Kirk Schafer - avatar
+ 1
python.org has documentation for all modules in the standard lib
9th Oct 2016, 7:24 PM
Luke Armstrong
+ 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.
10th Oct 2016, 4:14 PM
Kirk Schafer
Kirk Schafer - avatar