Extract sigle file from zip file based on file extension

Amit Yaron amit at phpandmore.net
Fri Feb 10 04:15:26 EST 2017


On 10/02/17 10:35, loial wrote:
> I need to be able to extract a single file from a .zip file in python.
> The zip file will contain many files. The file to extract will be the only .csv file in the zip, but the full name of the csv file will not be known.
>
> Can this be done in python?
>
Yes, you can use the 'zipfile' module to access the members of a zip 
file in python.
To learn more, click https://docs.python.org/2/library/zipfile.html





More information about the Python-list mailing list