Error with string.strip
Stephen Boulet
stepheb at comm.mot.com
Fri Apr 20 12:09:52 EDT 2001
Paolo Invernizzi wrote:
> Python 2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit (Intel)] on win32
> Type "copyright", "credits" or "license" for more information.
> >>> import string
> >>> string.strip(" 15157 ? 0:01 ttsession\012")
> '15157 ? 0:01 ttsession'
>
> "Stephen Boulet" <stepheb at comm.mot.com> wrote in message
> news:3AE05834.93331DA5 at comm.mot.com...
> > 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
> >
Hmm. I'm using 1.5.1 for HPUX 10.x. Maybe I need to upgrade...
-- Stephen
More information about the Python-list
mailing list