Not directly from Python. You can use an HTML template and pass it information via JS. I am working on a solution to this currently for a custom app.