I have dictionary and would like to produce html page where will be drawn simple html table with keys and values. How it can be done from python code?
output = "<html><body><table>"
for key in your_dict:
output += "<tr><td>%s</td><td>%s</td></tr>" % (key, your_dict[key])
output += "</table></body></html>
print output
You can use a template engine like Jinja. A list of engines for templating is available here.
You maybe interested by markup see http://markup.sourceforge.net/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With