首页 > 编程语言 > 详细

python读取txt大文件

时间:2018-11-29 23:03:37      阅读:221      评论:0      收藏:0      [点我收藏+]

直接上代码:

技术分享图片
import easygui
import os
s4 = []
s6 = []
path = easygui.fileopenbox()
if path:
    b = os.path.splitext(path)
    c = [b[0], _trace, .xyz]
    d = ‘‘.join(c)
    with open(d, w+) as f1:
        with open(path, r, encoding=utf-8) as f:
            for line in f:
                s1 = line.strip()
                s2 = (s1.strip().split( )[-6:-3][::-1])
                s3 =  .join(s2)
                f1.writelines(s3)
                f1.writelines(\n)
View Code

 

python读取txt大文件

原文:https://www.cnblogs.com/yibeimingyue/p/10041461.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!