Skip to content

Instantly share code, notes, and snippets.

View chl's full-sized avatar

Christian Langreiter chl

View GitHub Profile
@chl
chl / renderst.py
Created July 22, 2008 15:10 — forked from earl/renderst
#!/usr/bin/env python
# earl, 2008-07-22
from __future__ import with_statement
import stringtemplate3, simplejson, sys
def main():
with open(sys.argv[1]) as template_file:
template = stringtemplate3.StringTemplate(template_file.read())
template.attributes = simplejson.load(sys.stdin)
sys.stdout.write(unicode(template).encode('utf-8'))