[Tutor] run perl script files and capture results

eryksun eryksun at gmail.com
Sat Jan 12 10:18:28 CET 2013


On Fri, Jan 11, 2013 at 7:33 PM, Prasad, Ramit
<ramit.prasad at jpmorgan.com> wrote:
>
> Why not just use r'C:\Python27\\'? Might be too confusing for
> a beginner to remember, I suppose.

Off the top of my heard I can think of 3 raw-escape uses of backslash
in a raw string literal: placing an even number of backslashes at the
end of the literal (an odd number is a syntax error), including the
quote character, and raw line continuation (includes the LF):

    >>> list(r'\\')
    ['\\', '\\']

    >>> list(r'\'')
    ['\\', "'"]

    >>> list(r"\"")
    ['\\', '"']

    >>> s = r'\
    ... '
    >>> list(s)
    ['\\', '\n']


More information about the Tutor mailing list