0
1286
If sample.zip is a zip file available in location or directory C:\pythoneasy and you have to extract all its to C:\newfolder
import zipfile
path_to_zip_file = r'C:\pythoneasy'
zip_ref = zipfile.ZipFile(path_to_zip_file, 'r')
directory_to_extract_to = r'C:\newfolder'
zip_ref.extractall(directory_to_extract_to)
zip_ref.close()
All the contents of sample.zip file will be extracted to C:\newfolder
Comment here