Q: commenting multiple lines

Grant Griffin not.this at seebelow.org
Tue Oct 31 16:41:10 EST 2000


Hwanjo Yu wrote:
> 
> Hi,
> 
> Isn't there any way to comment out multiple lines without using '#' on every
> line ?
> Thanks.

You can achieve this effect using an unassigned "docstring".  A Python
docstring can span multiple lines; it begins and ends with triple
quotes, like this:

"""
this
is
a
docstring
"""

The docstring isn't strictly a "comment" you'll probably never notice
the difference.

commentari-ly y'rs,

=g2
-- 
_____________________________________________________________________

Grant R. Griffin                                       g2 at dspguru.com
Publisher of dspGuru                           http://www.dspguru.com
Iowegian International Corporation	      http://www.iowegian.com



More information about the Python-list mailing list