Created
September 9, 2017 15:54
-
-
Save cavb/023ddd129e37d1399d95768ed5ad31ce to your computer and use it in GitHub Desktop.
This file contains 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
# Replaces whitespaces with underscore of all files from this location | |
import os | |
path = os.getcwd() | |
filenames = os.listdir(path) | |
for filename in filenames: | |
os.rename(os.path.join(path, filename), os.path.join(path, filename.replace(' ', '_'))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment