Skip to content
Advertisement

How to display the Python Dictionary key and value pairs in HTML part of the python code

I am working on this code, I am doing web scraping from a website and getting the values and assigning it to the dictionary variable. Then, I am sending an email which contains the key and value pairs in the HTML format.

I got stuck in the displaying dictionary key and value pairs in the HTML part. I tried sending email but email is sent successfully to the target but, the dictionary values in HTML are getting printed and I am getting the code which is mentioned in the as it is.

JavaScript

Advertisement

Answer

You seem to be using Jinja2 template syntax, but you haven’t actually imported or used Jinja2 here, which you can do like this:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement