135-1821-9792

python3-分割文本文件

#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

分享名称:python3-分割文本文件
文章链接:http://wtcwzsj.com/article/iheigd.html

其他资讯



Copyright © 2009-2022 www.wtcwzsj.com 青羊区广皓图文设计工作室(个体工商户) 版权所有 蜀ICP备19037934号