[Tutor] How to add a description to a module

Hugo Arts hugo.yoshi at gmail.com
Tue Mar 23 20:30:22 CET 2010


On Tue, Mar 23, 2010 at 8:16 PM, Armstrong, Richard J.
<rarmstro at water.ca.gov> wrote:
> Hello,
>
>
>
> I have a simple question. I have created a module call Newmark.py and it
> runs fine, however, I want to add some documentation so that when I type in
> the console help(Newmark) it will give a description of the module. Any
> ideas?
>

Simply add a docstring to the top of your module, below the shebang
line but above the imports (At least that's where I always put it),
just like you would add documentation to functions and classes.

Here's the PEP describing docstring conventions:
http://www.python.org/dev/peps/pep-0257/

Hugo


More information about the Tutor mailing list