I am trying to go through a bunch of folders and go into each one and rename specific files to different names. I got stuck on just the loop through folders part.
My file system looks as follows:
for folder in os.listdir():
os.chdir(rootDir + 'folder')
for f in os.listdir():
Have a look at
import os for dir, subdirs, files in os.walk("."): for f in files: f_new = f + 'bak' os.rename(os.path.join(root, f), os.path.join(root, f_new))