[Tutor] Browser-based Python Interpreter

Rob rob@jam.rr.com
Thu, 06 Sep 2001 09:48:34 -0500


dman wrote:

 > 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
 >
 >


Although it's probably not even close to what you have in mind, I've 
seen that at least one of the projects known as Python Server Pages even 
allows you to make an interactive Python interpreter available via browser.

With a clever bit of security, this could be a mighty handy thing to 
have around.

Uselessly,
Rob
-- 
Aw, c'mon.... You indent ANYWAY!
Useless Python!
http://www.lowerstandard.com/python