Is there a way of writing Python embedded in HTML like I do with PHP or JSP?
Several templating engines support this in one way or another: Mako, Jinja, and Genshi are all popular choices.
Different engines support different features of Python and may be better suited to your needs. Your best bet is to try them out and see what works.
Can Python be embedded in HTML like PHP and JSP?