Created
October 12, 2009 06:04
-
-
Save inklesspen/208173 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 mako.template import Template | |
| >>> templatetext = r""" | |
| ... Hello! | |
| ... % for x in [1,2,3,4,5]: | |
| ... ${x} \ | |
| ... % endfor | |
| ... | |
| ... This is indented. | |
| ... Whee | |
| ... Now back out. | |
| ... % for x in [1,2,3,4,5]: | |
| ... ${x} | |
| ... % endfor | |
| ... """ | |
| >>> mt = Template(templatetext) | |
| >>> print mt.render() | |
| Hello! | |
| 1 2 3 4 5 | |
| This is indented. | |
| Whee | |
| Now back out. | |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| >>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment