您的位置:首页 > 编程语言 > Python开发

Python入门的36个例子 之 26 -> File In Console Out

2009-09-12 14:36 696 查看
源代码下载:下载地址在这里



# 029
aFile = file(r'C:/in.txt', 'r')
while True:
line = aFile.readline()
if len(line) == 0:
break
# end of if
print line,
# end of while
aFile.close()


output:

>>>

This is the first line.

This is the second line.

This is the third line.

>>>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐