私信  •  关注

Newb 4 You BB

Newb 4 You BB 最近创建的主题
Newb 4 You BB 最近回复了
7 年前
回复了 Newb 4 You BB 创建的主题 » python readlines()3.x到2.x

读取文件中的每一行并分配给变量 我在Python2.6.2中使用了这个方法

t=open(supportID+"stmp.txt","r")
lines = t.readlines()
t.close()
a=lines[0]
b=lines[1]
c=lines[2]
...