I am trying to style my HTML page created using Python, but somehow I am not getting it.
Following is my code without style tags
htmlfile = open(fruit+".html")
htmlfile.write("<html>\n")
htmlfile.write("<head>\n")
htmlfile.write("<title> homepage </title>\n")
htmlfile.write("</head>\n")
htmlfile.write("<body>\n")
htmlfile.write("<h1> <center> <b> {color:red;} Fruit-properties </b> </center> </h1>\n")
htmlfile.write("</body>\n")
anybody know how to add style tags in python?
<font color="red"> Fruit-properties </font></b> </center> </h1>\n")') or triple quotes for the actual python string. Check out the docs on strings.