Problem Commenting within Filehandle Iteration

Ben Finney bignose+hates-spam at benfinney.id.au
Thu Oct 26 10:27:34 CEST 2006


Wijaya Edward <ewijaya at i2r.a-star.edu.sg> writes:

>     if m:
>         print line,
>     else:
>         #print 'SPAM -- %s' % line

Simple answer:

    if m:
        print line,
    # else:
    #     print 'SPAM'


My preferred answer:

    if m:
        print line,

and get the lines back again later from your version control system.

-- 
 \     "I am an optimist. It does not seem too much use being anything |
  `\                                      else."  -- Winston Churchill |
_o__)                                                                  |
Ben Finney




More information about the Python-list mailing list