Python & TKInter applets

Alex Martelli aleaxit at yahoo.com
Wed Apr 11 12:17:33 EDT 2001


"Robert Johnson" <rjohnson at exotic-eo.com> wrote in message
news:3ad467f2$0$47994$e2e8da3 at nntp.cts.com...
> I am a Python newbie and I am wondering if Python and TKInter will allow
me
> to write web applications similar to what I can do with ActiveX.

Python can run on your server and do lots of wondrous things, but
that's pretty different from running an ActiveX on the _client_
machine.  Running Tkinter on your server will only make pretty
graphics *on your server box* -- they will not be seen by the
clients visiting your site!

To run a classic-Python application *on the client-side*, the
client-side would have to install Python or some packaging
thereof -- it's not really a "web application" any more then,
is it?  Although it may use various means to let the specialized
clients talk to Python programs on the server, admittedly.


> Apparently, ActiveX is not  Netscape-compatible, or so I'm told (what a

Or vice versa -- a zillion different application on Windows support
ActiveX... it's hardly the fault of the ActiveX architecture if
Netscape has decided to stay incompatible with it:-).

> surprise!).  I am writing an application that will plot an optical thin
film
> design.  It will contain some boxes with entry parameters and will plot a
> graph of the reflectance, transmission, tau, or rho for a particular thin
> film design over a range of wavelengths (I work for a laser optical
> manufacturer that specializes in thin film coatings).

This looks like something that might be run on the server-side, using
the client just to enter the parameters (a normal HTML form) and then
to display the resulting graphs (as images, or, maybe better, as a
structured-vector-graphics plot if you can convince your client-users
to download and install the appropriate SVG plug-in for their box --
I think Adobe makes free SVG plug-ins available for many browsers and
platforms, and it IS, I believe, a W3C recommendation/standard).

If you fear that would be too much load on your server, then you
need to do a better analysis of the client-side options, depending
on what client platforms you want to support.


> Another option (WAG)?
> I designed the original program with Borland C++ Builder and it works
great
> as an ActiveX program on the web page (it actually looks like a Windows
> program running on the web page).  Can I do something with Python that
will
> allow a Netscape browser to view the ActiveX applet (effectively making
the
> ActiveX component cross-platform)?   I know Python is supposed to be
capable
> of calling COM objects, though I have not looked into it or if this means
I
> can run the program in Netscape.

Python, with a suitable installation, can use ActiveX (through various
means, but the best and most flexible way is through Internet Explorer,
a highly-reusable collection of excellent components) *on Windows
platforms* -- this doesn't help you if you want your applications to
be used on NON-Windows platform.

What platforms, exactly, do you want to target?  Why does your app
need to be a "web" one (DOES it)?  Why does it need to be client-side
(DOES it)?

If the answers are 'all platforms', MUST be web-based e.g to allow
it being updated at any time, it must be client-side e.g. to leave
the server with a light load, then I think the ONLY answer you can
try is the JVM -- as least as a plug-in, it's available for most
browsers, and Python can run on reasonably-updated versions of it
(see www.jython.org).  Tkinter cannot run on the JVM -- it can only
run natively on the various different platforms; you will have to
use Java-classes for your GUI's -- awt, swing, whatever.


> Book recommendation:
> Has anyone read the book "Python and TKInter Programming" by John E.
> Grayson?  What did you think of the book?  Did it help?

I've only started browsing it, but it seems good.  However, it
will be of no help at all for the scenario you're outlining, alas.


Alex






More information about the Python-list mailing list