Last active
August 29, 2015 14:10
-
-
Save lozhn/8e03a09493e0ff8f3621 to your computer and use it in GitHub Desktop.
Solves unix limit dir limit. 2012. ITSumma
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
#!usr/bin/python | |
import os, os.path, shutil | |
os.chdir("data") | |
list_of_dir = [name for name in os.listdir('.') if os.path.isfile(name) or os.path.isdir(name)] | |
for var in list_of_dir: | |
if not os.path.exists(var[0:2].upper()) : | |
os.mkdir(var[0:2].upper()) | |
shutil.move(var, var[0:2].upper()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment