[Tutor] Browser-based Python Interpreter

dman dsh8290@rit.edu
Wed, 5 Sep 2001 20:26:41 -0400


On Wed, Sep 05, 2001 at 04:10:55PM -0700, Fred Allen wrote:
| I would like to find a Python interpreter that is adapted to operate
| independently via a browser, e.g. IE5.0.  To be clearer, I mean a Python
| facility akin to the Java Runtime Environment.  It seems I've
| encountered references to such facilities several times, but, now,
| cannot find them.  With thanks in advance for any's efforts, I am,

I'm not sure exactly what you mean by that -- the "Java Runtime
Environment" is a fancy way of saying "Java interpreter".  It is no
different than the python interpreter, except that it interprets java
bytcodes, not python source and bytecodes.

If you are looking for a way to write "java applets" in Python then
that is a little different.  The only special thing about Java is that
IE, Netscape, etc, have Java interpreters built in to them and the
<applet> tag is specified.  You could do the same thing with python,
but first you would need to convince web browser developers to include
a python interpreter and you would need to convince end-users to
upgrade.  Instead of that you can use Jython.  Jython is a python
interpreter that is written in Java so it runs in a JVM.  It is a
little bit more restrictive -- you can't use any C extension modules,
but it provides immediate access to all Java libraries.  You can write
(in python) a subclass of java.applet.Applet and compile the source to
java bytecode which your users can download and run in the JVM already
bundled with their web browser.

-D