命令如下:
f = open("c:\\1.txt","r")
lines = f.readlines()#读取全部内容
for line in lines
print line
实例 如下:
f = open("D:\\Python project\\Part 1\\script\\user.txt","r")
lines=f.readlines()
for line in lines:
print (line)
时间: 2024-10-10 22:16:35
命令如下:
f = open("c:\\1.txt","r")
lines = f.readlines()#读取全部内容
for line in lines
print line
实例 如下:
f = open("D:\\Python project\\Part 1\\script\\user.txt","r")
lines=f.readlines()
for line in lines:
print (line)