Skip to content

Instantly share code, notes, and snippets.

@kieranjol
Created September 3, 2019 14:17
Show Gist options
  • Save kieranjol/222ed6bb582d355ed5f137d0cc2546fc to your computer and use it in GitHub Desktop.
Save kieranjol/222ed6bb582d355ed5f137d0cc2546fc to your computer and use it in GitHub Desktop.
import os
import sys
import shutil
import ififuncs
inputs = sys.argv[1]
for dirs in os.listdir(inputs):
full_path = os.path.join(inputs, dirs)
new_dir, ext = (os.path.splitext(full_path))
if not os.path.isdir(new_dir):
os.makedirs(new_dir)
else:
print new_dir
if new_dir in full_path:
if os.path.isfile(full_path):
print('%s will be moved into %s' % (full_path, new_dir))
#shutil.move(full_path, new_dir)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment