Weakdancer
2012-05-10 16:19:43 +08:00
import os
#路径
PATH="C:/"
#解压
for path in os.listdir(PATH):
for f in os.listdir(path):
if f.endswith("zip"):
os.system("7z -x"+os.path.join(PATH,path,f))
for f in os.listdir(path):
if f.endswith("rar"):
os.system("7z -x"+os.path.join(PATH,path,f))
#删除
for path in os.listdir(PATH):
for f in os.listdir(path):
if f.endswith("zip") or f.endswith("rar"):
os.system("delete"+os.path.join(PATH,path,f))
import os
#路径
PATH="C:/"
#解压
for path in os.listdir(PATH):
for f in os.listdir(path):
if f.endswith("zip"):
os.system("7z -x"+os.path.join(PATH,path,f))
for f in os.listdir(path):
if f.endswith("rar"):
os.system("7z -x"+os.path.join(PATH,path,f))
#删除
for path in os.listdir(PATH):
for f in os.listdir(path):
if f.endswith("zip") or f.endswith("rar"):
os.system("delete"+os.path.join(PATH,path,f))
我只是在手机上写了下,可能有问题,需要有7zip