作者qwertmn (抽筋)
看板Python
标题Re: [问题] 批次读取字串、加入文字
时间Sun Oct 28 22:06:33 2012
可以考虑 string format
"".join(
["""<tr>
<td>{data[0]}</td>
<td>{data[1]}</td>
<td>{data[2]}</td>
</tr>""".format(data = line.split(" ") ) for line in lines]
)
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 211.74.121.206