from zipfile import *
with ZipFile(‘test.zip’, ‘w’) as zf:
zf.write(‘abc.txt’)
zf.write(’emp.txt’)
# Extracting files from archive
with ZipFile(‘test.zip’, ‘r’) as zf:
zf.extractall(‘f:\demo’)
Python programming examples – for beginners
Simple and easy to understand Python , R programming , Scala and Oracle examples for beginners
from zipfile import *
with ZipFile(‘test.zip’, ‘w’) as zf:
zf.write(‘abc.txt’)
zf.write(’emp.txt’)
# Extracting files from archive
with ZipFile(‘test.zip’, ‘r’) as zf:
zf.extractall(‘f:\demo’)