Created
May 21, 2020 11:36
-
-
Save WangYihang/9510ca7e899c702aff3bf6de0579a8f1 to your computer and use it in GitHub Desktop.
用于 zip 批量打包目录
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
import glob | |
import os | |
folders = glob.glob("./*/*") | |
cwd = os.getcwd() | |
for folder in folders: | |
os.chdir("{}{}".format(cwd, folder)) | |
command = "zip -9r {}.zip .".format(os.getcwd()) | |
print(command) | |
os.system(command) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment