python 代码片段18

#coding=utf-8
f=open('text.txt','w')
f.write('foo
')
f.write('bar
')
f.close()
f=open('test.txt','r')
for line in f:
	print line.rstrip()
原文地址:https://www.cnblogs.com/yufenghou/p/5100207.html