Skip to content

Instantly share code, notes, and snippets.

@inklesspen
Created November 28, 2008 06:52
Show Gist options
  • Save inklesspen/29928 to your computer and use it in GitHub Desktop.
Save inklesspen/29928 to your computer and use it in GitHub Desktop.
from mako.template import Template
from mako.lookup import TemplateLookup
import os
import os.path
cwd = os.getcwd()
template_path = os.path.join(cwd, 'templates')
mylookup = TemplateLookup(directories=[template_path])
mytemplate = mylookup.get_template("test.html")
print mytemplate.render(name="World")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment