Created
October 20, 2015 09:35
-
-
Save poc7667/717bb260ed959184cdbf to your computer and use it in GitHub Desktop.
not_working_jinjia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jinja2 import Template | |
fields = ["operating revenue", "gross operating profit", "EBITDA", "operating profit after depreciation", "EBIT", "date"] | |
# template_file = open('./fields_template.jinja2').read() | |
template_file = ''' | |
{%- for field in fields -%} | |
- | |
name: {{field}} | |
type: string | |
{%- endfor -%} | |
''' | |
template = Template(template_file) | |
html_rendered = template.render(fields=fields) | |
print(html_rendered) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment