ignore the hidden files in python

Posted xiaoxu-xli

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ignore the hidden files in python相关的知识,希望对你有一定的参考价值。

import os

root = "/Users/Siddhartha/Desktop/py scripts"
for item in os.listdir(root):
    if not item.startswith(\'.\') and os.path.isfile(os.path.join(root, item)):
        print item
        

Reference:
[1] https://stackoverflow.com/questions/15235823/how-to-ignore-hidden-files-in-python-functions

以上是关于ignore the hidden files in python的主要内容,如果未能解决你的问题,请参考以下文章

N天学习一个linux命令之diff

How do I list the files in a directory?

mysql报错:Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 63593957 and the

The specified Android SDK Build Tools version (29.0.0) is ignored, as it is below the minimum suppor

idea git ignore file 隐藏不需要提交的文件

Git ignore file for Xcode projects