"Jay Mutter III" <[EMAIL PROTECTED]> wrote >> Can you try printing the string repr just before the test. >> Or even the last 6 characters: >> >> print repr(line[-6:]) >> if line.endswith('No: \n') >> line = line.strip()
> Alan using your suggestion with the code aove here is the print out: > > jay-mutter-iiis-computer:~/documents/ToBePrinted jlm1$ python > test.py > 'andal\r' > ' No.\r' Just to be picky, the code I posted used a colon and a space whereas the repr shows a period and no space. And it's using \r so what happens if you run it again with: print repr(line[-6:]) if line.endswith('No.\r'): line = line.strip() Clutching at straws, Alan G. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor