expliot.core.common.fileutils

Module Contents

expliot.core.common.fileutils.readlines(file)

Helper method for reading one line at a time from a file and 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 and yielding them 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: