import os
dir_list = os.listdir('C:\Users\10107472\Desktop\practice\JPEGImages')
i=0
f1=open('C:\Users\10107472\Desktop\practice\train1.txt','r')
f2=open('C:\Users\10107472\Desktop\practice\train.txt','w')
# f3=open('C:\Users\10107472\Desktop\practice\train.txt','w')
line=f1.readline()
line=line[:-1]
while line:
line = f1.readline()
line = line[:-1]
f2.write(k+dir_list[i]+' '+line[49:])
f2.write(' ')
i=i+1
if i>800:
break
f1.close()