就是这种,该怎么办呢?
green_apple7
2016-03-24
4 回答
def output_html(self): fout=open('output.html','w',encoding="utf-8") fout.write("<html>") fout.write("<body>") fout.write("<head>") fout.write('<meta charset="utf-8">') fout.write("</head>") fout.write("<table>") for data in self.datas: fout.write("<tr>") fout.write("<td>%s</td>" % data['url']) fout.write("<td>%s</td>" % data['title']) fout.write("<td>%s</td>" % data['summary']) fout.write("</tr>") fout.write("</table>") fout.write("</body>") fout.write("</html>") fout.close()
试一下这样吧
举报
0/150
提交
取消