On Tue, 03 Jul 2007 06:16:43 -0700, [EMAIL PROTECTED] wrote: >On Jul 3, 7:15 am, alf <[EMAIL PROTECTED]> wrote: >> question without words: >> >> >>> r"\" >> File "<stdin>", line 1 >> r"\" >> ^ >> SyntaxError: EOL while scanning single-quoted string >> >>> r"\ " >> '\\ ' > >One slash escapes the following character, so the proper way of >writing it is either > >r"\\" or r"\"" > >See http://docs.python.org/ref/strings.html for more information.
I wonder if the OP was asking how to spell the one-length string \? In that case, the answer is that it can't be done using raw strings, but "\\" does it. Backslash escapes aren't interpreted in raw strings, but you still can't end a raw string with a backslash. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list