This is what I know about writing to an HTML file and saving it:
html_file = open("filename","w")
html_file.write()
html_file.close()
But how do I save to the file if I want to write a really long codes like this:
1 <table border=1>
2 <tr>
3 <th>Number</th>
4 <th>Square</th>
5 </tr>
6 <indent>
7 <% for i in range(10): %>
8 <tr>
9 <td><%= i %></td>
10 <td><%= i**2 %></td>
11 </tr>
12 </indent>
13 </table>
html_file.write(<td><font style="background-color:%s;">%s<font></td>' % (colour[j % len(colour)], k))
etc?print "string"
andprint("string")
. Stick with the one that is default in the python version you're using.""" long string goes here """
. So just store your HTML in a string variable:html_str = """long html string"""
. Then pass that variable towrite
:HTML_file.write(html_str)
. Does that help?