Print docstrings to shell

Gnarlodious gnarlodious at gmail.com
Tue Feb 1 20:05:28 EST 2011


On Feb 1, 5:30 pm, AndrĂ© Roberge <andre.robe... at gmail.com> wrote:

> ============test.py======
> import pydoc
>
> '''this is a test'''
>
> class A(object):
>         '''docstring'''
>         pass
>
> print(pydoc.help(__file__[:-3]))
> =============
>
> python test.py


OK that works, but only if I cd into the folder of the script. If I
run it from ~ I get the same error. How to get around that prob?

-- Gnarlie



More information about the Python-list mailing list