Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

AJAX => APAX? Or: is there support for python in browsers?

1 view
Skip to first unread message

Roger Erens

unread,
Nov 15, 2005, 5:27:32 AM11/15/05
to pytho...@python.org
Hello,

I remember that the first time I read about Python as a programming
language was when reading the W3C's HTML 4.01 specification a few years
ago. In the section on objects, images and applets
(http://www.w3.org/TR/html401/struct/objects.html) an example was given
like

<P><OBJECT classid="http://www.miamachina.it/analogclock.py">
<PARAM name="height" value="40" valuetype="data">
<PARAM name="width" value="40" valuetype="data">
This user agent cannot render Python applications.
</OBJECT>

It's also in the XHTML2.0 specification. Now, is this just a theoretical
example? Or is there a browser that _does_ support python scripts? Or do
we have to place our bets on the Mozilla 1.9 milestone with hard work
being done by Mark Hammond?

I'm asking because of all the AJAX hype going on. I'd like rather not
delve too deep into JavaScript and use Python instead.

Any insights to be shared?

Cheers,
Roger

Larry Bates

unread,
Nov 15, 2005, 9:04:54 AM11/15/05
to Roger Erens, pytho...@python.org

Take a look at this kit:

http://www.mochikit.com/

It seems that this is a python programmer that has created JavaScript
functions that "feel" a lot like Python. May just be a transitional
way to go, but I thought it was interesting anyway.

-Larry Bates

Larry Bates

unread,
Nov 15, 2005, 9:04:54 AM11/15/05
to Roger Erens, pytho...@python.org

Take a look at this kit:

Message has been deleted

sjde...@yahoo.com

unread,
Nov 15, 2005, 1:40:38 PM11/15/05
to
Crackajax uses py2js to convert python code to client-side Javascript
(so you develop in python).

I've not used it, but am interested in hearing from anyone who has.

http://www.aminus.org/blogs/index.php/phunt/2005/10/06/subway_s_new_ajax_framework
http://www.aminus.org/blogs/index.php/phunt/2005/10/09/psst_crackajax_is_in_svn

Stephen Prinster

unread,
Nov 15, 2005, 8:11:17 PM11/15/05
to
Roger Erens wrote:

>
> I'm asking because of all the AJAX hype going on. I'd like rather not
> delve too deep into JavaScript and use Python instead.
>
> Any insights to be shared?
>
> Cheers,
> Roger

In addition to the others already mentioned, you might want to check out
Nevow. Quoting from the website:

"Finally, Nevow includes LivePage, a two-way bridge between Javascript
in a browser and Python on the server. LivePage is compatible with
Mozilla, Firefox, Windows Internet Explorer 6, and Safari on Mac OS X.
Event handlers can be written in pure Python and Javascript
implementation details are hidden from the programmer, with Nevow taking
care of routing data to and from the server using XmlHttpRequest."

http://divmod.org/trac/wiki/DivmodNevow


Steve P.

Tim Roberts

unread,
Nov 16, 2005, 3:21:04 AM11/16/05
to
"Roger Erens" <r.e...@eurosys.nl> wrote:
>
>I remember that the first time I read about Python as a programming
>language was when reading the W3C's HTML 4.01 specification a few years
>ago. In the section on objects, images and applets
>(http://www.w3.org/TR/html401/struct/objects.html) an example was given
>like
>
><P><OBJECT classid="http://www.miamachina.it/analogclock.py">
><PARAM name="height" value="40" valuetype="data">
><PARAM name="width" value="40" valuetype="data">
>This user agent cannot render Python applications.
></OBJECT>
>
>It's also in the XHTML2.0 specification. Now, is this just a theoretical
>example? Or is there a browser that _does_ support python scripts? Or do
>we have to place our bets on the Mozilla 1.9 milestone with hard work
>being done by Mark Hammond?

Internet Explorer will allow any registered ActiveScript language to be
used in a web page. Python qualifies. In the latest Win32 extensions,
there is a script in win32comext/axscript/client/pyscript.py that will
register Python as an ActiveScript language.

The you can say

<script language="python">
print "<h1>Hello, there.</h1>"
</script>
--
- Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.

Alex Martelli

unread,
Nov 16, 2005, 11:53:19 AM11/16/05
to
Tim Roberts <ti...@probo.com> wrote:
...

> Internet Explorer will allow any registered ActiveScript language to be
> used in a web page. Python qualifies. In the latest Win32 extensions,
> there is a script in win32comext/axscript/client/pyscript.py that will
> register Python as an ActiveScript language.
>
> The you can say
>
> <script language="python">
> print "<h1>Hello, there.</h1>"
> </script>

Out of curiosity, how "sandboxed" is this Python? I remember a similar
solution being withdrawn once because it wasn't really safely sandboxed,
so the ``script'' could easily do any arbitrary damage to the machine...


Alex

Michael Schneider

unread,
Nov 16, 2005, 12:08:00 PM11/16/05
to
Alex,

Good point. Can python be used to write firefox extensions that could
be called from javascript?

1) javascript would come in on the HTML page
2) javascript would communication with the Extension API
3) the extension would be written in python

That way, you would only need to make your extension's API safe to the wild.

It would require the user to download an extension, but flash, et all
seem to do ok.

Is this possible today?

Thanks
Mike


PS. Sorry for my ignorance on this, I am a client-side developer,
trying to explore serious client development.


--
The greatest performance improvement occurs on the transition of from
the non-working state to the working state.

Tim Roberts

unread,
Nov 18, 2005, 12:01:50 AM11/18/05
to
al...@mail.comcast.net (Alex Martelli) wrote:

I remember this as well. I thought the holes were largely plugged, but I
admit to losing track of the discussion. Is Mark Hammond in the viewing
audience?

One of the compromises is that the pywin32 installer does not perform this
registration automatically. The script is present, but you have to run the
registration script yourself.

0 new messages