From a05e7871325f53f1055c8d57243b9e5c6730892b Mon Sep 17 00:00:00 2001 From: rsirres Date: Tue, 27 Dec 2016 13:39:15 +0100 Subject: [PATCH] Adding file reading line by line in nim --- Nim-for-Python-Programmers.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Nim-for-Python-Programmers.md b/Nim-for-Python-Programmers.md index adeb987..ef4f173 100644 --- a/Nim-for-Python-Programmers.md +++ b/Nim-for-Python-Programmers.md @@ -209,4 +209,9 @@ See [this](http://rosettacode.org/wiki/Abstract_type#Nim) var is_happy = if has_cat(): "quite" else: "not much" ``` +### Reading files line by line +``` Nim +for line in lines "yourfile.txt": + echo line +```