expliot.core.common.fileutils¶
Helper for handling files.
Functions¶
|
Helper method for reading one line at a time from a file. |
|
Helper method for reading one line at a time from two files. |
Module Contents¶
- expliot.core.common.fileutils.readlines(file)¶
Helper method for reading one line at a time from a file.
It will yielding it for loops. The file is closed automatically even if the caller exits the loop early (break, exception, etc).
- Parameters:
file – The file to read data from.
- Returns:
yield a line in a loop
- expliot.core.common.fileutils.readlines_both(file1, file2)¶
Helper method for reading one line at a time from two files.
It will yielding for loops. For each line in file1 it will also loop through all lines of file2. Total no. of yields is lines in file1 x lines in file2. The files are closed automatically even if the caller exits the loop early (break, exception, etc).
- Parameters:
file1 – The first file to read data from
file2 – The second file to read data from
- Returns: