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

 

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

 

posted @ 2018-11-22 19:43  anobscureretreat  阅读(375)  评论(0编辑  收藏  举报