I\'ve searched everywhere for this answer but can\'t find it.
I\'m trying to come up with a script that will search for a particular subfolder then check if it conta
With pathlib
this can be done as follows:
import pathlib
# helper function
def is_empty(_dir: pathlib.PAth) -> bool:
return not bool([_ for _ in _dir.iterdir()])
# create empty dir
_dir = pathlib.Path("abc")
# check if dir empty
is_empty(_dir) # will retuen True
# add file s to folder and call it again