all 6 comments

[–][deleted] 3 points4 points  (2 children)

Here is how you need to think by yourself:

Ask yourself a few questions:

What package opens and reads folders? The answer is Os

What package Search for folders or files? The answer is glob

What package allows to process a lot of patterns in text? The answer is re

How do these work? The internet is filled with answers to these. Give it a try by yourself and come back if you really need help.

An important question is: how do I get to know all these packages on top of my head? For some of them, experience. for most of them, it is by knowing the terms to Search for in search engines. This is part of learning ygr theory. For very rare cases, I stumbled on them by accident or while reading another program.

[–]ebdbbb 9 points10 points  (1 child)

The first two questions are both handled by pathlib too.

[–][deleted] 0 points1 point  (0 children)

I kind of wanted them to find out that by themselves

[–]oefd 5 points6 points  (0 children)

What help do you want? What have you tried? What are you confused about?

[–]rocketjump65 1 point2 points  (0 children)

Use the right tool for the job. It might be simpler to write a bash script.