I have a python module installed on my system and I\'d like to be able to see what functions/classes/methods are available in it.
I want to call the doc function
The Python documentation provides the perfect solution for this which uses the built-in function dir
.
You can just use dir(module_name) and then it will return a list of the functions within that module.
For example, dir(time) will return
['_STRUCT_TM_ITEMS', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'altzone', 'asctime', 'ctime', 'daylight', 'get_clock_info', 'gmtime', 'localtime', 'mktime', 'monotonic', 'monotonic_ns', 'perf_counter', 'perf_counter_ns', 'process_time', 'process_time_ns', 'sleep', 'strftime', 'strptime', 'struct_time', 'time', 'time_ns', 'timezone', 'tzname', 'tzset']
which is the list of functions the 'time' module contains.