How to comment a block of codes in Python?

Erik Max Francis max at alcyone.com
Thu Nov 14 01:05:59 EST 2002


Mindy wrote:

> Hey, this might be easy but I don't figure out myself.
> How to comment a block of codes(including a bunch of
> lines with indentation)? Now, I just use "#" to
> comment every line and it's so clumsy when I want to
> test part of the codes.

You can put the whole thing in an if 0: ... indentation, or use your
text editor to block comment a whole region.  This is the kind of thing
your text editor should be doing for you.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ I woke up this morning / You were the first thing on my mind
\__/ India Arie
    The laws list / http://www.alcyone.com/max/physics/laws/
 Laws, rules, principles, effects, paradoxes, etc. in physics.



More information about the Python-list mailing list