【发布时间】:2013-07-15 16:25:42
【问题描述】:
有没有办法在一行 python 代码中将行列表附加到文件中?我一直在这样做:
lines = ['this is the foo bar line to append','this is the second line', 'whatever third line']
for l in lines:
print>>open(infile,'a'), l
【问题讨论】:
标签: python string file append output