美文网首页
Python 字符串匹配

Python 字符串匹配

作者: 资源的搬运工 | 来源:发表于2019-01-03 17:42 被阅读0次

    import os

    import sys

    import string

    # fun2

    def get_all_pod_spec():

    path = os.path.expanduser('~/lazada_prj/Lazada4iPhone/Pods/')

    return os.listdir(path)

    # fun2

    def getpods():

    podspecs = get_all_pod_spec()

    print (len(podspecs))

    path = os.path.expanduser('~/lazada_prj/Lazada4iPhone/Pods/')

    for specin podspecs:

    subFrameworkPath = os.path.join(path, spec)

    if os.path.isfile(subFrameworkPath):

    print spec

    continue

            subFile = os.listdir(subFrameworkPath)

    for childFWin subFile:

    if string.find(childFW,'.framework') != -1:

    gfilePath = os.path.join(subFrameworkPath,childFW)

    gfiles = os.listdir(gfilePath)

    for gfilein gfiles:

    gfilename = childFW.replace('.framework','')

    if gfile==gfilename:

    nmpath = os.path.join(gfilePath,gfile)

    syscommnd ='nm -U '+nmpath

    output = os.popen(syscommnd, 'r')

    frameworkC = output.read()

    if readstdcxxOnly(frameworkC,childFW) =='find':

    continue

    def readstdcxxOnly(frameworkContent,framename):

    path = os.path.expanduser('~/libstcxx/libstdcxx.txt')

    fopen =open(path,'r')

    stdcxxContentLines = fopen.readlines()

    counti=1

        for templinein stdcxxContentLines:

    contentLine = templine.replace(' ','')

    contentLine = contentLine.replace('\n', '')

    contentLine = contentLine.replace(',', '')

    contentLine = contentLine.replace('[', '')

    contentLine = contentLine.replace(']', '')

    contentLine = contentLine.replace('"', '')

    counti = counti+1

            if len(contentLine)<3:

    continue

            if string.find(frameworkContent,contentLine) != -1:

    print framename+'---include libstdcxx---:'+contentLine

    return 'find'

        print 'notFount--'+framename

    return 'NotFind'

    # fun2

    def main(argv):

    getpods()

    # fun2

    if __name__ =='__main__':

    main(sys.argv)

    相关文章

      网友评论

          本文标题:Python 字符串匹配

          本文链接:https://www.haomeiwen.com/subject/ebrqrqtx.html