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
You can use this simple code:
dir_contents = [x for x in os.listdir('.') if not x.startswith('.')] if len(dir_contents) > 0: print("Directory contains files")
It checks for files and directories in the current working directory (.). You can change . in os.listdir() to check any other directory.
.
os.listdir()