Created
June 16, 2014 13:33
-
-
Save worldofchris/04ceb22691240b04a80e to your computer and use it in GitHub Desktop.
metaldog
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
import os | |
import subprocess | |
import sys | |
import shutil | |
f = open("music.txt", "r") | |
dest_root = os.path.normpath('c:/Users/graham/Desktop/music') | |
src_root = os.path.normpath("d:/users/graham/music/itunes/itunes media/music/") | |
for line in f: | |
print line | |
src = os.path.join(src_root, os.path.normpath(line.rstrip())) | |
dest = os.path.join(dest_root, os.path.normpath(line.rstrip())) | |
(head, tail) = os.path.split(line.rstrip()) | |
dest_dir = os.path.join(dest_root, head) | |
if not os.path.exists(dest_dir): | |
os.makedirs(dest_dir) | |
shutil.copy2(src, dest) | |
print dest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment