annotate tools/ssg101/ssg101.py @ 1201:fe10aea76cbd tip

Add 2023 MP3 compilation links
author Brian Neal <bgneal@gmail.com>
date Sun, 24 Mar 2024 14:50:23 -0500
parents b9514abc2a67
children
rev   line source
bgneal@1200 1 import jinja2
bgneal@1200 2
bgneal@1200 3
bgneal@1200 4 def main():
bgneal@1200 5 print('Hello World')
bgneal@1200 6
bgneal@1200 7 env = jinja2.Environment(
bgneal@1200 8 loader=jinja2.PackageLoader('ssg101'),
bgneal@1200 9 )
bgneal@1200 10 template = env.get_template('home.html')
bgneal@1200 11
bgneal@1200 12 with open('output/home.html', 'w') as fp:
bgneal@1200 13 fp.write(template.render())
bgneal@1200 14
bgneal@1200 15
bgneal@1200 16 if __name__ == '__main__':
bgneal@1200 17 main()