Skip to content

Python Code Snippets

Unzip

Ref: Unzipping files in Python

python
import zipfile
with zipfile.ZipFile(path_to_zip_file, 'r') as zip_ref:
    zip_ref.extractall(directory_to_extract_to)

Stdin

python
import sys
for line in sys.stdin:
    print(line.strip())

Changelog

Just observe 👀