展开全部
你好:来
代码如下源:baitxtpath1=r"a.txt"
txtpath2=r"b.txt"
txtpath3=r"c.txt"
fpa=open(txtpath1)
fpb=open(txtpath2)
fpc=open(txtpath3,"w")
arrB=[]
for lineb in fpb.readlines():
arrB.append(lineb)
def WriteC(flag):
for kk in range(flag,flag+11):
try:
fpc.write(arrB[kk])
except:
pass
for linea in fpa.readlines():
for i in range(len(arrB)):
if arrB[i]==linea:
WriteC(i)
break
print "Done!"
fpa.close()
fpb.close()
fpc.close()
帮到du你的话采zhi纳哦dao!