Re: [問題] 批次讀取字串、加入文字

看板Python作者 (抽筋)時間13年前 (2012/10/28 22:06), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/5 (看更多)
可以考慮 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
文章代碼(AID): #1GZJliEI (Python)
文章代碼(AID): #1GZJliEI (Python)