pint.utils.lines_of

pint.utils.lines_of(f)[source]

Iterate over the lines of a file, an open file, or an iterator.

If f is a string, try to open a file of that name. Otherwise treat it as an iterator and yield its values. For open files, this results in the lines one-by-one. For lists or other iterators it just yields them right through.