import os import fnmatch ls=os.listdir(r"E:pdf") #列出文件夹下所有的文件 for 文件名 in ls: if fnmatch.fnmatch(文件名,"[!a-z].pdf"): print(文件名)
1.pdf2.pdf3.pdf4.pdf>>>