Embedding an Application in a Web browser

paron rphillips at engineer.co.summit.oh.us
Wed Feb 15 08:05:02 EST 2006


I forgot -- I like the idea of Kerrigell, too. It runs on top of
CherryPy, and lets you use python either in the server (which is just a
little program on your local machine) or embedded in the html pages, or
in a Kerrigell service, which is an application server based on Python.

So, a script to print the squares of numbers from 1 to 9 looks like:

Python script +++++++++

print "<h1>Squares</h1>"
for i in range(10):
    print "%s :<b>%s</b>" %(i,i*i)


Karrigell service ++++++++

def index():
    print "<h1>Squares</h1>"
    for i in range(10):
        print "%s :<b>%s</b>" %(i,i*i)

HTML Inside Python +++++++

"<h1>Squares</h1>"
for i in range(10):
    "%s :<b>%s</b>" %(i,i*i)

Python Inside HTML +++++++

<h1>Squares</h1>
<%
for i in range(10):
    print "%s :<b>%s</b>" %(i,i*i)
%>

It's certainly flexible.

As far as your animated shapes go, you have a number of unattractive
options!

    Flash (my preference, if you already have the authoring software,)
    openLazslo (maybe the best bet for free),
    SVG (which requires a plug-in for IE,) or
    creating them and making them interactive with Javascript ( see
http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm )

Ron




More information about the Python-list mailing list