#将Stu_pack文件夹力度“万疆.txt”和“Dream It Possible.txt”合并到新的文件“万疆_DIP.txt”
fr_1=open('Stu_pack/万疆.txt','rt',encoding='utf-8')
fr_2=open('Stu_pack/Dream It Possible.txt','rt',encoding='utf-8-sig')
fw=open('demo/万疆_DIP.txt','w+')
for line in fr_1:
fw.write(line)
for line in fr_2:
fw.write(line)
fw.seek(2)
print(fw.read())
fr_1.close()
fr_2.close()
fw.close()
06-12
950
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-23
04-10
144
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)