一个python

#!/usr/bin/env python
#coding=utf-8
import os


# 遍历文件
r=input("type a directory name:")
for root,dirs,files in os.walk(r):
    for f in files:
        f1 = r;
        f1 += f
        file = open(f1)
        line = file.readline()
        if not line:
                break
        str_split = line.split('|')
        print str_split[3]

原文地址:https://www.cnblogs.com/fuhaots2009/p/3371988.html