Skip to content

Instantly share code, notes, and snippets.

@diericx
Created December 17, 2019 16:21
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 diericx/56b5d4a62df02d7dc6abbb4afad2f9a9 to your computer and use it in GitHub Desktop.
Save diericx/56b5d4a62df02d7dc6abbb4afad2f9a9 to your computer and use it in GitHub Desktop.
import os
dirs = [d for d in os.listdir(os.getcwd()) if os.path.isdir(d)]
for directory in dirs:
dotIndex = directory.find(". ")
if dotIndex >= 0:
newDirectory = directory[dotIndex+2:]
os.rename(directory, newDirectory)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment