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的主要内容,如果未能解决你的问题,请参考以下文章