I have a large ASCII logo that I want to save in a docstring. This logo contains several copies of three double double quotes. The size and complexity are such that escaping individual characters is not a realistic option. Given that in no case is it an instance of three consecutive double quotes in isolation on the line, how can this logo be stored in the dock?
Here is a minimal example:
logo = """
hello"""world
"""
The resulting error is as follows:
hello"""world
^
SyntaxError: invalid syntax
source
share