Skip to content

Instantly share code, notes, and snippets.

@dungdm93
Last active October 18, 2018 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dungdm93/b0d2d5eee4d8f59e9a2bae92722e3ab1 to your computer and use it in GitHub Desktop.
Save dungdm93/b0d2d5eee4d8f59e9a2bae92722e3ab1 to your computer and use it in GitHub Desktop.
Render Jinja template
import jinja2
loader = jinja2.FileSystemLoader(searchpath="./")
env = jinja2.Environment(loader=loader)
TEMPLATE_FILE = "template.j2"
template = env.get_template(TEMPLATE_FILE)
output = template.render()
print(f"[{output}]")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment