Print docstrings to shell
andre.roberge at gmail.com
Wed Feb 2 02:53:11 CET 2011
On Tuesday, February 1, 2011 9:21:48 PM UTC-4, André Roberge wrote:
> import pydoc
> import os
> import sys
> '''this is a test'''
> class A(object):
> _path, _file_name = os.path.split(__file__)
> _module_name = _file_name[:-3]
Actually, one does not need to import pydoc; using help() without importing seems to work just as well (or as badly, as it displays it twice...)
> Note: I've included an underscore in variables names so that they would not appear.
> Note 2: for some reason, which I do not understand, it shows the help twice (i.e. I have to hit "q" twice to make it go away). Sorry that I can not help with this.
More information about the Python-list