• Home
  • Tech
Safha
  • Home
  • Tech
    • All
    • Windows
    What is a Virtual IP (VIP)?

    What is a Virtual IP (VIP)?

    Private Vs Public IP Addresses

    Private Vs Public IP Addresses

    Proxy Vs Reverse Proxy

    Proxy Vs Reverse Proxy

    Content Delivery Network (CDN)

    Content Delivery Network (CDN)

    Building Modern IT Data Centers

    Building Modern IT Data Centers

    What is Virtualisation?

    What is Virtualisation?

No Result
View All Result
  • Home
  • Tech
    • All
    • Windows
    What is a Virtual IP (VIP)?

    What is a Virtual IP (VIP)?

    Private Vs Public IP Addresses

    Private Vs Public IP Addresses

    Proxy Vs Reverse Proxy

    Proxy Vs Reverse Proxy

    Content Delivery Network (CDN)

    Content Delivery Network (CDN)

    Building Modern IT Data Centers

    Building Modern IT Data Centers

    What is Virtualisation?

    What is Virtualisation?

No Result
View All Result
Safha
No Result
View All Result
  • Home
  • Tech
Home Tech

Unzipping multiple Zip Files in a folder using Python

Chief Editor by Chief Editor
January 28, 2025
in Tech
0
Unzipping multiple Zip Files in a folder using Python
0
SHARES
11
VIEWS
Share on FacebookShare on Twitter

Pre-Requisite:

  • Python is installed on your machine
  • Open IDLE (Python Shell)
  • Import os and zipfile. If import fails, then follow this link to install the failed ones in Python.
  • Make sure all zipped files are in one folder
  • Make sure there is a separate folder where we want our unzipped files to be

In IDLE, type

>>>import os, zipfile
>>>os.getcwd()
'C:\\Program Files\\Python37'

Below command will change the current working directory to the folder where we have placed our zip files.

Note: in Windows, we use double back slashes. Also, in place of ‘xyz’, will be actual user name. OR It can be any folder on any drive.

>>> os.chdir('C:\\Users\\xyz\\Downloads\\zip')

Verify that current working directory is changed

>>>os.getcwd()
'C:\\Users\\xyz\\Downloads\\zip'

Extracting files from Zip files

>>>file=os.listdir()
>>>for i in range(len(file)): (press enter)
unzip=zipfile.ZipFile(file[i]) (press enter)
unzip1=unzip.extractall('C:\\Users\\xyz\\Downloads\\unzip') (Press Enter Twice)

Open the unzip folder to confirm that all the files are extracted from zip files. Enjoy!!!

Previous Post

How to do a clean Install of Windows 11

Next Post

Installing third party modules in Python

Chief Editor

Chief Editor

Next Post
Installing third party modules in Python

Installing third party modules in Python

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Trending
  • Comments
  • Latest

How to do a clean Install of Windows 11

January 28, 2025
How a website is accessed from a Web Server

How a website is accessed from a Web Server

March 9, 2025
What is Virtualisation?

What is Virtualisation?

February 15, 2025
XML file parsing with Python

XML file parsing with Python

January 29, 2025

How to do a clean Install of Windows 11

0
Unzipping multiple Zip Files in a folder using Python

Unzipping multiple Zip Files in a folder using Python

0
Installing third party modules in Python

Installing third party modules in Python

0
XML file parsing with Python

XML file parsing with Python

0
What is a Virtual IP (VIP)?

What is a Virtual IP (VIP)?

March 7, 2025
Private Vs Public IP Addresses

Private Vs Public IP Addresses

February 21, 2025
Proxy Vs Reverse Proxy

Proxy Vs Reverse Proxy

February 16, 2025
Content Delivery Network (CDN)

Content Delivery Network (CDN)

February 16, 2025
  • Home
  • Tech

© 2025 Safha - We are all about Technology and Finance Learning and Knowledge Sharing

No Result
View All Result
  • Home
  • Tech

© 2025 Safha - We are all about Technology and Finance Learning and Knowledge Sharing