All these leading backslashes should be double slashes `\\`, or else the initial definition can be `out=r"""\`.  Otherwise you just got lucky that none of the sequences like `\c` or `\d` or `\m` is a special character (https://docs.python.org/2.0/ref/strings.html).