python – Search for a file type in multiple folders and save the hierarchy

Could someone help me?

I have the following situation, I have a folder that contains several projects, each project has an automation folder and in the automation folder several types of folders:
Game_play, Menu, Settings
and in these folders is the folder with the python code.

My problem is, how could I go about selecting and listing each file? example
Games List>,,
List of menus,,

so I tried:

global import

list = []:
for air in glob.glob (& # 39 ;. py & # 39;):
list.append (air)

print (list)

but only the list of the py of the final file.

how could I make him go through all the files?
In the end, I will convert the list to Json, but this part I've already learned to do

Sorry for nothing, it's my first post and now that I'm learning python.