diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-04-30 15:14:56 +0200 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-04-30 15:14:56 +0200 |
commit | 4223e9afd4401bd930ca815ffa816eb76fad83f6 (patch) | |
tree | b8907fc631e2ad61b7c8741304b8cd6e6e4a53de /Reading a file line-by-line in Python is easy with a for loop.md | |
parent | f43d0473320b9b2297b1a00880316aee9066b81a (diff) |
vault backup: 2025-04-30 15:14:56
Diffstat (limited to 'Reading a file line-by-line in Python is easy with a for loop.md')
-rw-r--r-- | Reading a file line-by-line in Python is easy with a for loop.md | 10 |
1 files changed, 10 insertions, 0 deletions
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) +``` |