I have a parent directory with a list of sub directories. Each of these sub directories contains a file named data.json. I want to walk through all the sub directories and carry out some editing operations on the data.json file. How do I achieve this ? presently I am doing the following :
for dir,dirs, files in os.walk("."):
for filename in files:
if file == 'data.json':
with open(file, 'r') as f:
#carry out editing operation
But I dont see any editing happenning. I suspect the data.json file is not being located.