每截取一千行生成一个文件
index = 0
count = 0
fileIn = open("D:/xiaoaojianghu_jinyong/%d.txt" % index, "w",encoding='utf-8' )
with open("D:/xiaoaojianghu_jinyong.txt","r",encoding='utf-8') as fileOut:
for line in fileOut:
count+=1
fileIn.write(line)
if count == 1000:
fileIn.close()
count = 0
index+=1
fileIn = open("D:/xiaoaojianghu_jinyong/%d.txt" % index, "w",encoding='utf8')
fileIn.close()