"Jay Mutter III" <[EMAIL PROTECTED]> wrote
> inp = open('test.txt','r')
> s = inp.readlines()
> for line in s:
> if line.endswith('No.'):
> line = line.rstrip()
> print line
BTW,
You do know that you can shorten that considerably?
With:
for line in open('test.txt'):
if line.endswith('No.\n'):
line = line.rstrip()
print line
--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor