On 4/1/07, Jay Mutter III <[EMAIL PROTECTED]> wrote:

> For some reason this never works for me;

That's because you are ignoring the linefeed character:

[...]
>      if line.endswith('No.'):

>>> s1 = "some line\n"
>>> s2 = "some line"
>>> s1.endswith("line"), s2.endswith("line")
(False, True)

Just skip the if and simply rstrip the string.


-- 
- Rikard - http://bos.hack.org/cv/
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to