编辑代码

# coding:utf-8
import os
def LookUpDict(dic,tn):
    tns=tn
    File=[]
    Get=[]
    GetName=""
    for root,dirs,files in os.walk(dic):
        for file in files:
            File.append(os.path.join(root,file))
    for i in range(len(File)):
        tns=tn
        Long=len(File[i])
        GetName=""
        for j in range(len(tn)+1):
            GetName=GetName+str(File[i][Long-(len(tn)-j)-1])
        if tn!="":
            tns="."+tns
        if GetName == str(tns):
            Get.append(File[i])
    return Get