am I stupid

John Carter jnc at ecs.soton.ac.uk
Tue May 23 12:20:06 EDT 2000


Or,

How do I put a backslash as the last character in a raw string.

See the text below, cut from idle,

Python 1.5.2 (#0, Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
IDLE 0.5 -- press F1 for help
 >>> a='hello\\'
 >>> print a
hello\
 >>> a=r'helo\'
SyntaxError: invalid token
 >>> a=r'hello\\'
 >>> print a
hello\\
 >>> 

Note the line before SynaxError

John Carter
jnc at ecs.soton.ac.uk



More information about the Python-list mailing list