Skip to content

Instantly share code, notes, and snippets.

@polyvertex
Created March 26, 2016 11:01
Show Gist options
  • Save polyvertex/b6d337fec7011a0f9292 to your computer and use it in GitHub Desktop.
Save polyvertex/b6d337fec7011a0f9292 to your computer and use it in GitHub Desktop.
A glob.iglob that include dot files and hidden files
import glob
def iglob_hidden(*args, **kwargs):
"""A glob.iglob that include dot files and hidden files"""
old_ishidden = glob._ishidden
glob._ishidden = lambda x: False
try:
yield from glob.iglob(*args, **kwargs)
finally:
glob._ishidden = old_ishidden
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment