468,247 Members | 1,296 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,247 developers. It's quick & easy.

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

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
Nov 22 '05 #1
13 1196
Roger Erens wrote:
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


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
Nov 22 '05 #2
Roger Erens wrote:
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


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

Nov 22 '05 #3
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.ph...ajax_framework
http://www.aminus.org/blogs/index.ph...ajax_is_in_svn

Nov 22 '05 #4
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.
Nov 22 '05 #5
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.
Nov 22 '05 #6
"Roger Erens" <r.*****@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.
Nov 22 '05 #7
"Roger Erens" <r.*****@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.
Nov 22 '05 #8
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
Nov 22 '05 #9
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
Nov 22 '05 #10
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.

Alex Martelli wrote:
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

--
The greatest performance improvement occurs on the transition of from
the non-working state to the working state.
Nov 22 '05 #11
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.

Alex Martelli wrote:
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

--
The greatest performance improvement occurs on the transition of from
the non-working state to the working state.
Nov 22 '05 #12
al***@mail.comcast.net (Alex Martelli) wrote:
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...


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.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Nov 22 '05 #13
al***@mail.comcast.net (Alex Martelli) wrote:
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...


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.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Nov 22 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.