How do I escape a backslash and a single quote or double quote in Python?
For example:
Long string = \'\'\'some \'long\' string \\\' and \\\" some \'
I try this to print a single backslash (Python 3):
single_backslash_str = r'\ '[0] print('single_backslash_str') #output: \ print('repr(single_backslash_str)') #output: '\\'
Hope this will help!