<div dir="ltr">1. That would require going out of the pathlib framework. I  can do that but it's more of a mess because then I need to convert the results back to Path objects.<div>2. Not sure how I would use fnmatch, because I wouldn't want to give it the list of all files recursively, since that would be a long list of files (lots of files in ".git" folder that I want to ignore.) I want it to first ignore everything in the ".git" folder completely without going over all the files, and then include all the other files recursively.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 4, 2015 at 9:04 PM, Laura Creighton <span dir="ltr"><<a href="mailto:lac@openend.se" target="_blank">lac@openend.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">In a message of Fri, 04 Dec 2015 21:00:47 +0200, Ram Rachum writes:<br>
>What do you think about implementing functionality similar to the `find`<br>
>utility in Linux in the Pathlib module? I wanted this today, I had a script<br>
>to write to archive a bunch of files from a folder, and I decided to try<br>
>writing it in Python rather than in Bash. But I needed something stronger<br>
>than `Path.glob` in order to select the files. I wanted a regular<br>
>expression. (In this particular case, I wanted to get a list of all the<br>
>files excluding the `.git` folder and all files inside of it.<br>
<br>
</span>fnmatch <a href="https://docs.python.org/3.6/library/fnmatch.html" rel="noreferrer" target="_blank">https://docs.python.org/3.6/library/fnmatch.html</a><br>
wasn't sufficient for your needs?<br>
<span class="HOEnZb"><font color="#888888"><br>
Laura<br>
</font></span></blockquote></div><br></div>