Escape curly bracket together to a variable extension

Gary Herron gherron at islandtraining.com
Sat Mar 6 19:41:44 CET 2010


Joan Miller wrote:
> How to escape the first '}' in the next string?
>
> s = "}\n{0}".format('foo')
>   
 >>> "}}\n{0}".format('foo')
'}\nfoo'


Gary Herron



More information about the Python-list mailing list