From 4223e9afd4401bd930ca815ffa816eb76fad83f6 Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Wed, 30 Apr 2025 15:14:56 +0200 Subject: vault backup: 2025-04-30 15:14:56 --- ...ng a file line-by-line in Python is easy with a for loop.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Reading a file line-by-line in Python is easy with a for loop.md (limited to 'Reading a file line-by-line in Python is easy with a for loop.md') diff --git a/Reading a file line-by-line in Python is easy with a for loop.md b/Reading a file line-by-line in Python is easy with a for loop.md new file mode 100644 index 0000000..d011e91 --- /dev/null +++ b/Reading a file line-by-line in Python is easy with a for loop.md @@ -0,0 +1,10 @@ +--- +tags: + - python +--- +An easy and efficient way to read a file line-by-line is by simple using the file object as the iterable. + +``` +for line in file: + print(line) +``` -- cgit v1.2.3