Last active
February 1, 2016 20:06
-
-
Save dangayle/5855580 to your computer and use it in GitHub Desktop.
Easy python batch file rename one-liner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
In the terminal, go to the directory of the files you want to rename | |
Open yer python CLI, import os, then one-liner. I guess technically 2-liner | |
""" | |
import os | |
[os.rename(f, f.replace('_','-')) for f in os.listdir('.')] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment