#D盘中有文件test.txt
files=open("D:\test.txt","r+")
#先读取一行
str=files.readline()
#循环读取
while str:
print str
str=files.readline()
files.close()

#D盘中有文件test.txt
files=open("D:\test.txt","r+")
#先读取一行
str=files.readline()
#循环读取
while str:
print str
str=files.readline()
files.close()