Python embedded like PHP
Jim Abrams
jim at publishingresources.com
Fri Mar 22 15:54:48 EST 2002
"Rob Nikander" <nikander at nc.rr.com> wrote in news:Tjtj8.48802$3O2.18198075
@typhoon.southeast.rr.com:
> Are there any projects out there that allow you to embed python in HTML
> like PHP? I like the PHP-style of embedding the bits of program in HTML,
> but I'd like to use python...
> Something like:
>
> <html>
> <?python
> print "<ul>"
> for reptile in ["Crocodile", "Python", "Iguana", "Tortoise"]:
> print "<li> %s </li>" % reptile
> print "</ul>"
> ?>
> </html>
While mentioning M$ is this thread might get me lynched I still feel the
need to mention (esp since I'm forced to live in a M$ shop) Python in ASP.
I find it very attractive to be able to do
<%
print >> _out, "<ul>"
for reptile in ["Crocodile", "Python", "Iguana", "Tortoise"]:
print >> _out, "<li> %s </li>" % reptile
print >> _out, "</ul>"
%>
or even
<%
import HTMLgen
print >> _out, UL(["Crocodile", "Python", "Iguana", "Tortoise"])
%>
adding another jelly bean to the shring to MH ly 'yrs
-Jim
More information about the Python-list
mailing list