with open("E:\machineLearning/Tianchi/CTCN_data/CTCN_data/CTCN_data/Activity1.3_train_rgb.txt", "r") as f:
i=0
for line in f.readlines():
line = line.strip('\n') #去掉列表中每一个元素的换行符
a=line.split(' ')#按空格分隔
print(a[0])
python读取txt文件
最新推荐文章于 2024-07-15 10:22:47 发布