Created
November 24, 2012 19:50
-
-
Save kitsunde/4141184 to your computer and use it in GitHub Desktop.
remove whitespace from dirs if there's no file named .lut in the dir
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
#!/usr/bin/python | |
def de_specify_dirs(): | |
import os | |
for dir in os.listdir('./'): | |
if not os.path.isdir(dir): continue | |
path = os.path.join('./', dir) | |
if [ file for file in os.listdir(path) if file.endswith('.lut') ]: | |
continue | |
os.rename(path, path.replace(' ', '_')) | |
if __name__ == "__main__": | |
de_specify_dirs() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment