Python 对文件内容迭代 按行处理

来源:互联网 发布:多核优化软件 编辑:程序博客网 时间:2024/06/04 17:56
def process(string):    print 'Processing: ',stringf=open(r'D:\\ruanjian\\Python\\程序\\1.txt')while True:    line=f.readline()    if not line:break    process(line)f.close()


Processing:  this isn't a haiku

0 0
原创粉丝点击