Skip to content

Instantly share code, notes, and snippets.

@WangYihang
Created May 21, 2020 11:36
Show Gist options
  • Save WangYihang/9510ca7e899c702aff3bf6de0579a8f1 to your computer and use it in GitHub Desktop.
Save WangYihang/9510ca7e899c702aff3bf6de0579a8f1 to your computer and use it in GitHub Desktop.
用于 zip 批量打包目录
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