def write_template(template, path, **kwargs): template = Environment().from_string(template) content = template.render(**kwargs) print(path) with open(path, "w+") as f: f.write(content)