You probably are looking for this which would mean your string would be written as string = r")("
which would be escaped. Though that is from 2008 and in python 2 which is being phased out. What the r
does is make it a "raw string"
See: How to fix "<string> DeprecationWarning: invalid escape sequence" in Python? as well.
What you're dealing with is string literals which can be seen in the PEP 8 Style Guide
UPDATE For Edit in Question:
If you're trying to split on ")(" then here's a working example that doesn't throw PEP8 warnings:
import re
string = r"Hello my darling)(!"
print(string)
string = re.split(r'\)\(', string)
print(string)
Which outputs:
Hello )(world!
['Hello ', 'world!']
Or you can escape the backslash explicitly by using two backslashes:
import re
string = r"Hello )(world!"
print(string)
string = re.split('\\)\\(', string)
print(string)
Which outputs the same thing:
Hello )(world!
['Hello ', 'world!']