how to zip archive a folder (quick and easy) with python

preview_player
Показать описание
Learn how to ZIP a folder, with python.

In this bite-sized tutorial, we will create a zip archive of a folder using python.
We will use pathlib to crawl the folder, then we'll use zipfile to compress the local folder.
All this in about 25/30 lines of code.

0:00 let's learn how to archive a folder using python
0:23 crawling the path with pathlib
1:40 archiving the folder with zipfile
4:44 trying it out
5:33 closing

keywords

python / zip / archiving / archive / pathlib / zipfile / tutorial / how to / howto / how-to / coding / software development / programming / compress
Рекомендации по теме
Комментарии
Автор

can you create the zip file with only the files without the directory tree?

OnCod-dn
Автор

Hey, great tutorial. Wondering why views are so low :/ Good luck you in the future :D

coozyface
Автор

How to protect the zip file with a password

peterkim