Skip to content

Commit e0c71d9

Browse files
committed
added script for unzipping file
1 parent dfbed4b commit e0c71d9

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

unzip file/Readme.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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

unzip file/unzip.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+

0 commit comments

Comments
 (0)