Hi,
Is there any better way to insert a python variable to template string to use
HTMLTemplateFormatter
I did:
kast=‘Kastamonu’
template_il="""<div style=“background:<%=
(function colorfromint(){
if (il.indexOf(’”""+kast+"""’) !== -1){
return(“orange”)}
}()) %>;
color: black">
<%= value %>
“”"
formatter_il = HTMLTemplateFormatter(template=template_il)
when I used python string format:
I got:
“”".format(kast)
ValueError: unexpected ‘{’ in field name
regards