From 66596707e4fd1ff309e710db0ccc6a918b32ff78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Tue, 19 Jan 2016 19:57:59 +0100 Subject: [PATCH] --- genera.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 genera.py diff --git a/genera.py b/genera.py new file mode 100644 index 0000000..0a99184 --- /dev/null +++ b/genera.py @@ -0,0 +1,12 @@ +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))