1
0
mirror of https://github.com/balkian/gists.git synced 2024-11-22 09:42:28 +00:00
gists/repos/d08fb2dd1b01cb8b46ac/genera.py

13 lines
354 B
Python
Raw Normal View History

2016-01-19 18:57:59 +00:00
from __future__ import print_function
import csv
from jinja2 import Template
with open('PC Members.tsv') as f:
contacts = csv.DictReader(f, delimiter='\t')
with open('index.j2') as templatefile:
template = Template(templatefile.read())
with open('web/index.html', 'w') as web:
web.write(template.render(contacts=contacts))