def generate_file_from_template(template_path, output_path, template_values):
    """Write to file.

    Args:
        template_path (str): Input template path
        output_path (str): Path of the output file
        template_values (dict): Values to replace the
                                ones in the input template
    Returns:
        bool: Whether or not file has been generated
    """

    try:
        with open(template_path, 'r') as in_tmpl:
            tmpl_contents = in_tmpl.read()
            out_contents = tmpl_contents.format(**template_values)
        with open(output_path, 'w') as out_file:
            out_file.write(out_contents)
            return True
    except EnvironmentError:
        pass
    return False