[Tutor] Basic question about docstrings

Danny Yoo dyoo at hashcollision.org
Wed Jul 29 22:00:13 CEST 2015


On Jul 29, 2015 12:45 PM, "David Aldrich" <David.Aldrich at emea.nec.com>
wrote:
>
> Hi
>
> If I have a script called main.py and document a function in it:
>
> def get_value(x):
>     """
>     Some text ...
>     :param x:     Some value
>     :returns:      Something useful
>     """
>
> What is the most basic way of showing those docstrings at the Python
prompt?

Try:

   help(get_value)

At the Python prompt.  This uses the built in help facility:

https://docs.python.org/2/library/functions.html#help


More information about the Tutor mailing list