You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
390 B
Python

import json
from jinja2 import Environment, FileSystemLoader
with open("playlist.json","r") as d:
playlist_obj = json.load(d)
fileLoader = FileSystemLoader("templates")
env = Environment(loader=fileLoader)
rendered = env.get_template("playlist.html").render(playlist=playlist_obj,title="text archaeology")
fileName = "index.html"
with open(f"{fileName}","w") as f:
f.write(rendered)