逐行读取txt文件
path = r'D:1234561.txt'
with open(path, 'r', encoding='utf-8') as f:
for line in f:
value = line[:-1] #去掉换行符
print(value)
逐行读取txt文件
path = r'D:1234561.txt'
with open(path, 'r', encoding='utf-8') as f:
for line in f:
value = line[:-1] #去掉换行符
print(value)