Error with string.strip

Joshua Marshall jmarshal at mathworks.com
Fri Apr 20 12:06:42 EDT 2001


Stephen Boulet <stepheb at comm.mot.com> wrote:
> Can someone tell me why this doesn't work? Thanks.

>>>> import string
>>>> string.strip("all's well as ends well     ")
> "all's well as ends well"
>>>> string.strip(" 15157 ?         0:01 ttsession\012")
>   File "<stdin>", line 1
>     string.strip(' 15157 ?         0:01 ttsession\012')
>                                                        ^
> SyntaxError: invalid syntax

This works work me (stripping off the \012) using Python 1.5.2 and
2.1a2 on Linux.



More information about the Python-list mailing list