Fredrik Lundh <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
>
> > My preferred answer:
> >
> > if m:
> > print line,
> >
> > and get the lines back again later from your version control system.
>
> switching debugging statements on and off by rolling back to an
> earlier release st
Ben Finney wrote:
> My preferred answer:
>
> if m:
> print line,
>
> and get the lines back again later from your version control system.
switching debugging statements on and off by rolling back to an earlier
release strikes me as a somewhat misguided use of version control.
--
Wijaya Edward <[EMAIL PROTECTED]> 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 f
In <[EMAIL PROTECTED]>, Wijaya Edward
wrote:
> if m:
> print line,
> else:
> #print 'SPAM -- %s' % line
> myfile.close()
>
> […]
>
> Notice that I wanted to comment out the #print line there.
> However I found problem with myfile.close(), with identation error.
> This erro
Wijaya Edward wrote:
> if m:
> print line,
> else:
> #print 'SPAM -- %s' % line
> myfile.close()
>
> Sometime while developing/debugging the code we usually
> put in such situation. Where expression under "else"
> is not yet supplied, yet we would like see the printout of
Hi all,
I have the following code:
import sys
import re
ham_count = 0
spam_count = 0
myfile = open('full/index')
for line in myfile.readlines():
p = re.compile('ham')
m = p.match(line)
if m:
print line,
else:
#print