let us say you want to print :
{text}
using
'{ {} }'.format(content)
how to escape the {}?
'\{ {} \}'.format(content)
works not the answer ==========
the answer is to double curly braces like that :
'{{ {} }}'.format(content)
simple !
handling curly braces in string formatting - python
let us say you want to print :
{text}
using
'{ {} }'.format(content)
how to escape the {}?
'\{ {} \}'.format(content)
works not the answer ==========
the answer is to double curly braces like that :
'{{ {} }}'.format(content)
simple !