Skip to content

Instantly share code, notes, and snippets.

@acbetter
Created July 23, 2018 01:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acbetter/01cb29d04e0368eb03353abd93dec3b7 to your computer and use it in GitHub Desktop.
Save acbetter/01cb29d04e0368eb03353abd93dec3b7 to your computer and use it in GitHub Desktop.
Batch Rename Files by Python
import os
os.chdir('your-path-here')
print(os.listdir('.'))
for filename in os.listdir('.'):
os.rename(filename, filename.replace('src', 'opt'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment