Re: Best Practice Question

Discussion in 'Python' started by Albert Hopkins, Feb 5, 2013.

  1. [...]
    > 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
    >
    >

    "Even in a raw string, string quotes can be escaped with a backslash,
    but the backslash remains in the string; for example, r"\"" is a valid
    string literal consisting of two characters: a backslash and a double
    quote; r"\" is not a valid string literal (even a raw string cannot end
    in an odd number of backslashes). Specifically, a raw string cannot end
    in a single backslash (since the backslash would escape the following
    quote character). " -- python docs
    Albert Hopkins, Feb 5, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bryan Ax
    Replies:
    0
    Views:
    589
    Bryan Ax
    Jun 26, 2003
  2. Prince

    Best Practice - Question

    Prince, Jan 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    330
    Kevin Spencer
    Jan 19, 2004
  3. Josh

    Best Practice Question

    Josh, Jun 23, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    324
    Mike Labosh
    Jun 23, 2005
  4. Jason MacKenzie

    Best Practice Question

    Jason MacKenzie, Nov 21, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    381
    Jason Kester
    Nov 22, 2005
  5. oldyork90
    Replies:
    1
    Views:
    150
    Jeremy J Starcher
    Sep 10, 2008
Loading...

Share This Page