Home > Backend Development > Python Tutorial > Use python to read files applet

Use python to read files applet

高洛峰
Release: 2017-03-10 18:53:14
Original
2212 people have browsed it

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()
Copy after login


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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template