[Tutor] Tutor Digest, Vol 38, Issue 2
Alan Gauld
alan.gauld at btinternet.com
Thu Apr 5 18:57:27 CEST 2007
"Jay Mutter III" <jmutter at uakron.edu> wrote
> Whether I attempt to just strip the string or attempt to
>
> if line.endswith('No.\r'):
> line = line.rstrip()
>
> It doesn't work.
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()
See if that helps narrow down the cause...
> This is an imac running python 2.3.5 under OS-X 10.4.9
Shouldn't make any odds.
Weird,
Alan G.
More information about the Tutor
mailing list