def gen_write_file(out_filepath, generator_source):
    """
    Writes generator output to a file.
    :param out_filepath: File to write
    :param generator_source: Generator to consume from
    :return: None
    """
    with open(out_filepath, 'w') as f:
        for item in generator_source:
            f.write(str(item))
