Python is an open license programming language available in Windows, Linux and Mac, plus Java .Net virtual machines. Python features three versions, with each newer version adding more compatibility and features. Zip files are compressed files that save space on a hard drive by grouping the files together to lower the overall size. Python can create, manage and extract zip files.
- Skill level:
Open the Python compiler. Make sure all the lines are empty of text by highlighting and deleting any text.
Copy and paste the following into the compiler:
fullpathToZip = "c:\temp\zip_file.zip"
destination Path = "c:\temp\Extracted"
source Zip = zipfile.ZipFile(fullpathToZip, 'r')
for name in sourceZip.namelist():
if name.find('.txt')!= -1
sourceZip.extract(name, destination Path)
Change the second line of the text command to represent the zipfile that you wish to extract. Change the third line of the command to represent the destination where you'd like the files to be extracted.
Change the file association in the sixth command line to the type of file that you wish to extract from the zip file. Run the script and watch as the files are extracted and presented to you.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for