码迷,mamicode.com
首页 > 编程语言 > 详细

python 输出大文本文件

时间:2016-03-13 11:18:54      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:

输出固定函数

>>> with open(rd:\test.txt,r) as f:
    for i , v in enumerate(f):
        if i>10:
            break
        print(v)

i,v分别是迭代的索引和值

 

python 输出大文本文件

标签:

原文地址:http://www.cnblogs.com/fj0716/p/5271306.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!