Created
February 1, 2012 19:28
-
-
Save paitonic/1718781 to your computer and use it in GitHub Desktop.
unzip all .zip files in directory
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 | |
path = sys.argv[1] | |
for fname in os.listdir(path): | |
(name, ext) = os.path.splitext(fname) | |
if ext == '.zip': | |
ret = subprocess.call("mkdir" + " {0}".format(name), shell=True) | |
ret = subprocess.call("mv" + " {0} {1}".format(fname, name), shell=True) | |
ret = subprocess.call("unzip" + " {0}/{1} -d {0}".format(name, fname, name), shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment