import re


def fill_template(template, vars, s = "<", e = ">"):
    """
    Search and replace tool for filling template files.
    Replaces text bounded by the delimiters `s` and `e`
    with values found in the lookup dictionary `vars`.
    """
    exp = s + "\w*" + e
    matches = re.findall(exp, template)
    for m in matches:
        key = m[1:-1]
        template = template.replace(m, str(vars.get(key, m)))
    return template