I want a list of the built-in function names of Python3, which I can get from help(__builtins__)
.
I thought grep
the fetching results of help(__builtins__)
would do.
Something like below in bash:
$ python3 -c "help(__builtins__)" | grep -E "^\s{4}[a-z]+\("
So, first I tried to capture the help function's results into a variable like below. But didn't work.
>>> result = help(__builtins__)
>>> print(result)
none
Since the "help()
" function was intended for an interactive use, it launched the help page and couldn't get the output.
I googled with "python3 how do i get the output of help function" and referenced the below 2 article.
- Getting the docstring from a function @ StackOverflow
- How do I export the output of Python's built-in help() function @ StackOverflow
But didn't work for me.
>>> print(__builtins__.__doc__)
Built-in functions, exceptions, and other objects.
Noteworthy: None is the `nil' object; Ellipsis represents `...' in
slices.print(__builtins__.__doc__)
There's a good chance that I couldn't understand the answers of the above questions. But as a Python beginner, these didn't fully address my question.
Before doing grep
and all, is there any way to get the help
function's results into a variable rather than using exec
?
Thanks in advance.