File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ # Unzip File
2+
3+ ### Description This python script makes use of zipfile package
4+
5+ - ZipFile module is imported from zipfile package to make the script work
6+ - this script first opens the zip file in readmode and the prints all the files by unzipping them
7+
8+ ## Setup instructions
9+
10+ - Clone the repo to your machine
11+ - head over to the required(unzip file folder)
12+ - add the zip file's path that you want to extract after adding the file in the "unzip file" folder
13+ - run the script
14+
15+ ## Detailed explanation of script, if needed
16+
17+ ` This python script is used to unzip file and it makes use of ZipFile module to do the same `
18+
19+ ### Screenshots ## Output
20+
21+ - Before unzipping
22+ <img src =" https://i.imgur.com/LsfKUfB.png " >
23+
24+ - After unzipping
25+ <img src =" https://i.imgur.com/ftA88Vq.png " >
26+
27+ ## Author
28+
29+ Achyut Kumar
30+
31+ ## Disclaimers, if any
32+
33+ You have to include the file to be unzipped in this project's folder only
Original file line number Diff line number Diff line change 1+ # importing required modules
2+ from zipfile import ZipFile
3+
4+ # specifying the zip file name
5+ file_name = "Enter your zip file here"
6+
7+ # opening the zip file in READ mode
8+ with ZipFile (file_name , 'r' ) as zip :
9+ # printing all the contents of the zip file
10+ zip .printdir ()
11+
12+ # extracting all the files
13+ print ('Extracting all the files now...' )
14+ zip .extractall ()
15+ print ('Done!' )
16+
You can’t perform that action at this time.
0 commit comments