You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
469 B
Python

import inspect
import os, os.path as osp
import zipfile
def current_function_name(depth=1):
return inspect.getouterframes(inspect.currentframe())[depth].function
def make_zip_archive(src_path, dst_path):
with zipfile.ZipFile(dst_path, 'w') as archive:
for (dirpath, _, filenames) in os.walk(src_path):
for name in filenames:
path = osp.join(dirpath, name)
archive.write(path, osp.relpath(path, src_path))