How to comment a block of codes in Python?

Roy Smith roy at panix.com
Thu Nov 14 08:08:13 EST 2002


In article <3dd375fd at dnews.tpgi.com.au>,
 "Ben C" <b.e.n.c.a.t.7.3. at .t.p.g...c.o.m...a.u> wrote:

> try """ to start and """ to end commented section
> 

This breaks if there are """'s inside the code block.  For manually 
commenting something out for testing, I guess that's a pretty minor 
problem, but just something to be aware of.

Personally, I like the idea of putting #'s in front of every line.  It 
can be done automatically, it doesn't break no matter what's on the 
lines, and it makes it really obvious what's going on.



More information about the Python-list mailing list