while i < size:
            splited = wlist[i].strip().split('\t')
            if len(splited) == 1:
                wlist[i - 1] = wlist[i - 1].strip() + wlist[i]
                wlist.pop(i)
                i = i-1
                size = len(wlist)
            i = i + 1

["eth0\tno\teth0\n","pan0\t\tno\eth1\t\n","\t\t\eth2"]压缩为["eth0\tno\teth0\n","pan0\t\tno\eth1\t\\t\t\eth2"]

在pop的时候同时计算索引和长度。

posted on 2018-11-14 19:36  保质期两天  阅读(86)  评论(0编辑  收藏  举报