File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Extract contents of a specified path of ZIP file
2
+
3
+ A script to extract all the contents of a specified path of ZIP file.
4
+
5
+ ## How to use this script?
6
+ Just type the following in your command prompt:
7
+
8
+ python script.py
9
+
10
+ ## Screenshot
11
+ After running the script we will find the extracted file in the current directory.
12
+
13
+ ![ demo] ( https://user-images.githubusercontent.com/56690856/99141235-5b4e1000-266f-11eb-8798-a0315a0f834c.png )
Original file line number Diff line number Diff line change
1
+ from zipfile import ZipFile
2
+
3
+ def main ():
4
+ # Enter the path of the zip file
5
+ zipFile = input ("Enter zip file:" )
6
+ print ("Extracted file in ZIP to current directory" )
7
+ # create a ZipFile object in READ mode and name it as zipObj
8
+ with ZipFile (zipFile , 'r' ) as zipObj :
9
+ # extractall the files from a zip file
10
+ zipObj .extractall ();
11
+
12
+ if __name__ == '__main__' :
13
+ main ()
You can’t perform that action at this time.
0 commit comments