How to create a zip archive of a directory in Python?

后端 未结 25 2634
暗喜
暗喜 2020-11-22 07:12

How can I create a zip archive of a directory structure in Python?

25条回答
  •  礼貌的吻别
    2020-11-22 08:11

    You probably want to look at the zipfile module; there's documentation at http://docs.python.org/library/zipfile.html.

    You may also want os.walk() to index the directory structure.

提交回复
热议问题