-
-
Save offby1/4a26b298d77a381f90e2 to your computer and use it in GitHub Desktop.
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
%{ for count in range(0, multis) -%} | |
%{{ count %}} & A & B & C & D\\ \hline | |
%{ set count = count + 1 -%} | |
%{ endfor -%} | |
%{{ multis %}} & X & X & X & X\\ \hline |
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
import jinja2 | |
import os | |
report_renderer = jinja2.Environment( | |
block_start_string = '%{', | |
block_end_string = '%}', | |
variable_start_string = '%{{', | |
variable_end_string = '%}}', | |
loader = jinja2.FileSystemLoader(os.path.abspath('.')) | |
) | |
with open('jinja.tmp') as inf: | |
print(report_renderer.from_string(inf.read()).render( multis = 10)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment