5
1
What is the command-line to print the docstrings in a given Python file?
I thought there was something like:
$ python --showhelp foo.py
Name Help
--------------------------------------------------
bar This is the docstring for bar().
baz This is the docstring for baz().
I have never come over anything that can do this while I have been coding in python. I think you have to either make a parser yourself or open Idle and use the built in help() function. – Mogget – 2013-08-27T01:06:12.643
Similar response to @Mogget, I have only seen
print ClassName.__doc__
orprint ClassName.Method.__doc__
- meaning that you could fairly easily make a parser. – nerdwaller – 2013-08-27T01:16:36.383