Skip to content

Instantly share code, notes, and snippets.

@copocaneta
Last active December 9, 2024 23:06
Show Gist options
  • Save copocaneta/732eb5e413494dca518ab73efdbf4061 to your computer and use it in GitHub Desktop.
Save copocaneta/732eb5e413494dca518ab73efdbf4061 to your computer and use it in GitHub Desktop.
Improve this code by optimizing data flow
# Loading all lines of a file into memory
with open("large_data.txt", "r") as file:
lines = file.readlines()
for line in lines:
# Processing each line
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment