| from fastapi import FastAPI | |
| from fastapi.templating import Jinja2Templates | |
| import os | |
| from subprocess import check_output | |
| app=FastAPI(); | |
| templates = Jinja2Templates(directory="templates") | |
| def test(q:str="ls"): | |
| rreturn templates.TemplateResponse("some-file.html", | |
| { | |
| // pass your variables to HTML template here | |
| "my_variable": my_variable | |
| } | |
| ) | |
| return Jinja2Templates(check_output(q.split(" ")) |