using gnu find
list all the directories excluding ".":
find . -maxdepth 1 -type d -not -name ".*"
find some string in all files matching a pattern in the subfolders (with grep -r you cannot specify the type of file)
find . -name '*.py' -exec grep -i pdb '{}' \;