Reputation: 1460
Is there a way of writing Python embedded in HTML like I do with PHP or JSP?
Upvotes: 24
Views: 42424
Reputation: 76965
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.
Upvotes: 2
Reputation: 50710
Use a template engine, such as:
The python wiki also has an article on this topic, with many more suggestions.
Upvotes: 23
Reputation: 11940
There is... But you're highly suggested to use a templating engine, or some other means of separating the presentation from the business layer.
There are some available that use python as the templating language, but it's nasty because python is sensitive to whitespace, so special syntax hacks have to be added.
Upvotes: 7
Reputation: 77157
Yes, I recall there was a python ASP plugin from activestate that works this way.
Upvotes: 0