3 ms·
Very cool! In this case, since the injected text will end in a newline, that approach will work (and it appears to work with r"""triple-quoted\'s""" But I do
by sheetjs 13y ago
Very cool! In this case, since the injected text will end in a newline, that approach will work (and it appears to work with r"""triple-quoted\'s"""
But I do see syntax errors if the bare slash is at the end:
>>> r'slash at end\'
File "<stdin>", line 1
r'slash at end\'
^
SyntaxError: EOL while scanning string literal
- cstejerean 13y agoYeah, that's about the only restriction. From the docs: Specifically, a raw string cannot end in a single backslash (since the backslash would escape the following quote character).