Unzip all zipped files in a folder to that same folder using Python 2.7.5
问题 I would like to write a simple script to iterate through all the files in a folder and unzip those that are zipped (.zip) to that same folder. For this project, I have a folder with nearly 100 zipped .las files and I'm hoping for an easy way to batch unzip them. I tried with following script import os, zipfile folder = 'D:/GISData/LiDAR/SomeFolder' extension = ".zip" for item in os.listdir(folder): if item.endswith(extension): zipfile.ZipFile.extract(item) However, when I run the script, I