How to zip folders with python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to zip folders with python?

There is a code https://code.sololearn.com/cwzaU0RRjcXu. It does not work with folder names, which contains space. source = ['D:\\123','D:\\456','"D:\\123 456"'] If i remove ,'"D:\\123 456"' then everything works good. What wrong?

17th May 2020, 6:03 PM
Стромков Сергей
Стромков Сергей - avatar
1 Answer
+ 2
You can use import zipfile, and then the mehods provided from this module. To get details about this module see: https://docs.python.org/3.7/library/zipfile.html
17th May 2020, 6:38 PM
Lothar
Lothar - avatar