Escape curly bracket together to a variable extension

Alf P. Steinbach alfps at start.no
Sat Mar 6 13:38:23 EST 2010


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

s = "}}\n{0}".format('foo')


Cheers & hth.,

- Alf



More information about the Python-list mailing list