Skip to content

Instantly share code, notes, and snippets.

@shravan-kuchkula
Created February 9, 2018 03:07
Show Gist options
  • Save shravan-kuchkula/98ebdafc3315d222df4f295c664a242b to your computer and use it in GitHub Desktop.
Save shravan-kuchkula/98ebdafc3315d222df4f295c664a242b to your computer and use it in GitHub Desktop.
remove spaces from filenames inside a directory using a python script
import os
files = os.listdir(os.getcwd())
[os.replace(file, file.replace(" ", "_")) for file in files]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment