delete row in an html doc using python -
i writing python script writes html code html document. however, printing html doc thing can do. have rows don't need, i'm not sure how delete rows printing? i've tried using deleterow(index) method, doesn't work because have not created table objects. can write html code inside, such as resultfile.write("<td> %s </td>" %line) resultfile.write("<td> 0 </td>") please, if don't question, don't mark down. i'm new stackoverflow, , 1 reputation can't anything. assuming working in context of append-only operations file point of view, should add want write list first, scan , delete not want, , write file. more specifically, can create mylines = [] , , replace occurrences of resultfile.write mylines.append . then, loop through copy of mylines , keep lines like. finally, loop through remaining items , call resultfile.write on each item. for item in mylines: resultfile.write(item)