python function that creates HTML for a row containing two cells -


I am looking to write a function in Python which accepts a dictionary and a key as a parameter HTML is a line containing two cells. I want to put the key / value pair in the dictionary with the dictionary

dictionary -

  d = {'year': 1999, 'director': 'Mike Judge ',' Title ':' Office Space '}   

The function may look like but my guess is;

  DIF create HTMLRow (d, 'title'): s = & lt; Table range = "1" & gt; \ Ns = s + "& lt; tr & gt; \ n" s = s + "\ t  line1, cell 1  \ n" s = s + \ N "s = s +" & lt; / tr & gt; \ n "  

Is this the right direction to go in?

I want to use my Python code on Google App Engine, which is why I am writing HTML in Python.

  create def HTML rau (d, 'title '): "Post-lesson" itemprop = "text"> 

S = "& lt; tr & gt; \ n \ t" s + = "& lt; td>% (year) d & lt ; / Td> \ n \ t "s + =" & lt; td> gt (%) \ n "s + ="

This sample uses Python string formatting with the dictionary.

Comments