筛选出指定内容开头的文件名

import os
with os.scandir(r"C:UsersmacnameDesktop") as it:
    for entry in it:
        if entry.name.startswith('Auto') and entry.is_file():
            print(entry.name)

原文地址:https://www.cnblogs.com/sea-stream/p/10003459.html