# Printing and extracting zip files #


# importing modules

from zipfile import ZipFile

  

# specifying  file name

# alternate ways->  file_name = “zipfilename.zip"

file_name = input (“input the zip file name: “)

  

# read zip file

with ZipFile(file_name, 'r') as zip:


    # printing contents of zip file

    print(‘List of the zip file content’)

    zip.printdir()

  

    # extracting files

    print('Extracting the files now...')

    zip.extractall()

    print(‘Completed’)



Comments