Home  >  Article  >  Backend Development  >  Use python to read files applet

Use python to read files applet

高洛峰
高洛峰Original
2017-03-10 18:53:142180browse

This article introduces the use of python to read files

os
sys
re
xlwt

Filelist = []
FileNum  = bw = {}
iops = {}


(SubStrListStr):
    flag = substr SubStrList:
        (substr Str):
            flag = flag


(startendstr):
    result = re.findall(+start++end+str)
    x result:
        x


():
    FlagStr = []  FileNum

    filename os.listdir(os.path.dirname(os.path.realpath(__file__))):
        (IsSubString(FlagStrfilename)):
            Filelist.append(filename)
            FileNum = FileNum + FileNum

    (filename):
    file = (filename)

    lst[]
    r=file.readline()
        (r) ==:
            r.count() ==(line):
            :
            lst.append(r)

    i lst:
        i

():
    i Filelist:
        ReadFile(i)
        ():
    wb = xlwt.Workbook()
    = wb.add_sheet()

__name__==:

    GetFilelist()

    FileLoop()


The above is the detailed content of Use python to read files applet. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn