过滤掉指定内容开头的文件名

 

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

 

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