When using a format string in Python, use curly braces to specify placeholders. If you want to use the curly braces themselves as a string, you need to overlay the curly braces as follows.
Escape of curly braces
>>> 'test {{{0}}}'.format('hoge')
'test {hoge}'
Note that you cannot escape with a backslash.
(ref) http://docs.python.org/2.7/library/string.html#formatstrings
Recommended Posts