Best Practice Question

python.list at tim.thechases.com python.list at tim.thechases.com
Tue Feb 5 10:17:54 EST 2013


On Tue, 5 Feb 2013 15:32:32 +0100 (CET), Jean-Michel Pichavant wrote:
> By the way, did someone ever notice that r'\' fails ? I'm sure
> there's a reason for that... (python 2.5) Anyone knows ?
> 
> r'\'
> SyntaxError: EOL while scanning single-quoted string

I hit this all the time with Vim's path-completion (":help
i_CTRL-X_CTRL-F") on Win32 which puts a trailing "\" on
directory-names.  I just need to remember to remove it, a task made
easier because the syntax highlighting correctly shows how Python
interprets it (i.e., the string is still continued).

-tkc





More information about the Python-list mailing list