python3-分割文本文件

发布时间:2019-09-13 09:25:50编辑:auto阅读(1625)

    #myhaspl@myhaspl.com
    fId=1
    with open("tf-allsrc.txt","r") as sf: 
        while True:
            with open("tf-src-"+str(fId)+".txt","w+") as f:
                data=sf.read(1024*1024*5)
                if not data:
                    break
                f.write(data)
                print(fId,"#",end=".")
            fId+=1

关键字

上一篇: H3C 3100系列

下一篇: python爬虫笔记-day3