I need to run the following script for each txt file located in all subfolders. 
The main folder is "simulations" in which there are different subfolders (called as "year-month-day"). In each subfolder there is a txt file "diagno.inp". I have to run this script for each "diagno.inp" file in order to have a list with the following data (a row for each day): 
"year-month-day", "W\_int", "W\_dir"
Here's the code that is working for only a subfolder. Can you help me to create a loop?

```
fid=open('/Users/silviamassaro/weather/simulations/20180105/diagno.inp',  "r")
subfolder="20180105"
n = fid.read().splitlines()[51:]
for element in n:
    "do something" # here code to calculate W_dirand W_int for each day
     print (subfolder, W_int, W_dir)

```