Skip to content

Instantly share code, notes, and snippets.

@vinimonteiro
Created April 16, 2021 15:25
Show Gist options
  • Save vinimonteiro/92d0531e2d1158724097c24e98f704fe to your computer and use it in GitHub Desktop.
Save vinimonteiro/92d0531e2d1158724097c24e98f704fe to your computer and use it in GitHub Desktop.
Row count large file with function
def file_reader(file_path):
rows = []
for row in open(file_path, "r"):
rows.append(row)
return rows
def print_row_count():
count = 0
for row in file_reader("large_file"):
count += 1
print(f"Total count is {count}")
print_row_count()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment