When trying to run a script containing the following code for generating text block:
from textwrap import dedent
text = dedent("""\
yada yada '1' ('2','3',4')
('{0}', Null, '{1}',
'{
"Hello":"world",
}', '1', '{2}');""").format("yada1","yada2","yada3")
I get consistent error KeyError '\n "Hello"
and trace back pointing at the line of the .format()
.
When I remove the format
everything is ok, but I need it to enter parameters dynamically.
(Originally its reside inside a loop)