Category "python-zipfile"

Python - Compress all files in a directory using zipfile module

I'm trying to compress all files in a folder (the folder does not have any subdirs) using python zipfile module but can't seem to get the desired output. I ha

Extracting large files with zipfile

I'm trying to extract a zip file of 1.23 GB with zipFile library. But it gives the following error: compression type 9 (deflate64) Here's my code: zip_ref

Report compression progress for ZipFIle

Is it possible to monitor/report compression progress for zipfile.ZipFile()? I found an explanation for how to monitor extraction progress here, but I guess a

Extract file that contains specific string on filename from ZIP using Python zipfile

I have a ZIP file and I need to extract all the files (normally one) that contain the string "test" in the filename. They are all xlsx files. I am using Python

Extracting large files with zipfile

I'm trying to extract a zip file of 1.23 GB with zipFile library. But it gives the following error: compression type 9 (deflate64) Here's my code: zip_ref

How to read data from a zipfile on a website without locally downloading zipfile

I am using the following piece of code: import zipfile import urllib link = "http://www.dummypage.com/dummyfile.zip" file_handle = urllib.urlopen(link) zip_fi

Python Zipfile extractall IOError on Windows when extracting files from long paths

I'm running python zipfile extractall, its extracting to a path which is longer than 255 characters. Running this on windows 7 64bit. I'm getting to following e

I am getting a syntax error while importing the zipfile module in python 2.7

python command in script: import zipfile Output on screen Chetans-MacBook-Pro:work chetankshetty$ python myprog.py Traceback (most recent call last): File

How to know the folder size in a zipfile

I know that you can get the size in bytes of a file in a ZIP file using the .file_size method But is there any what I can get the size of a folder instead? Ex:

extract files inside zip sub folders with python zipfile

i have a zip folder that contains files and child zip folders. I am able to read the files placed in the parent folder but how can i get to the files inside the

Python 2.7.12 zipfile password exception

I have a question to the zipfile library in python 2.7.12. It seems that if I try to extract a .zip that is password protected, an exception is thrown. I am ab

Listing all directories recursively within the zipfile without extracting in python

In Python we can get the list of all files within a zipfile without extracting the zip file using the below code. import zipfile zip_ref = zipfile.ZipFile(zipf

How do I request a zipfile, extract it, then create pandas dataframes from the csv files?

Load in these CSV files from the Sean Lahman's Baseball Database. For this assignment, we will use the 'Salaries.csv' and 'Teams.csv' tables. Read these tables

extract only the subfolder, not the whole folder

Is it possible to extract only a subfolder from an archive, rather than the whole folder? I.E. : I have my .zip/.tar.gz file named my_archive, which has inside

Create zipfile: TypeError: object of type 'ElementTree' has no len()

I'm writing a xml data to the zip. from xml.etree.ElementTree import Element, SubElement, ElementTree from zipfile import ZipFile def create_tree(): root

zipfile in Python produces not quite normal ZIP files

In my project set of files are created and packed to ZIP archive to be used at Android mobile phone. Android application is opening such ZIP files for reading i

Python ZipFile doesn't recognize file as zipfile

I have a bunch of zipfiles that I'm trying to extract (all from the same source) and there is one that throws an error BadZipFile: File is not a zip file He

How to put files in a zip archive using Python zipfile

I wrote a python(3.5) script that creates backup of my files in zip archive and it works well. I use windows and I installed zip command from GnuWin32 for this

python zipfile module: How to change the structure of zip archive created? [duplicate]

I wrote the following code in order to zip bin_file_path: zf = zipfile.ZipFile(file_to_search, mode='w') zf.write(bin_file_path) zf.close(

python zipfile multiple files

i am having problems with python and zipfile, namely: I can't add a second file to my zip. here is my code, if you need more, I'll be glad to provide it. def z