-2

I need a excluded list feature that, given a specific filename or directory name, it can tell me if they should be excluded (just like .gitignore). And it needs to support both specific names such as /home/abc/test or wildcard cases such as /home/*/test/ (All test directory of ALL directories under /home).

I thought it's quiet a standard feature, is there any existing package can do that? (I checked the glob module but it only expands the * to one directory level.)

Hanks
  • 349
  • 1
  • 2
  • 15
  • Possible duplicate of [Python, how to implement something like .gitignore behavior](http://stackoverflow.com/questions/25229592/python-how-to-implement-something-like-gitignore-behavior) – Lex Scarisbrick Jul 12 '16 at 19:48

1 Answers1

0

Thanks Lex. I think fnmatch.fnmatchcase is what I'm looking for.

Hanks
  • 349
  • 1
  • 2
  • 15