Last active
November 3, 2022 11:41
-
-
Save aashishrbhandari/9f8c1e7dc1823ed028622bad81e8f089 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Best Practise | |
# Reference: https://stackoverflow.com/questions/11482342/read-a-large-zipped-text-file-line-by-line-in-python/11482347 | |
# If Reading a Zipped/Compressed File | |
import zipfile | |
with zipfile.ZipFile(zip_file) as z: | |
with z.open(zip_file) as f: | |
for line in f: | |
print(line) | |
# If Reading a File Effectively & Effecienctly | |
with open(normal_file) as f: | |
for line in f: | |
print(line) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment