What is Python good for?

Ken Seehof kseehof at neuralintegrator.com
Thu Sep 13 07:25:51 CEST 2001


Peter Hansen wrote:
> Ken Seehof wrote:
> > 
> > Some languages are exceptional at one thing and weak in others.
> > Other languages are more general purpose.  Python is a general
> > purpose language.  In fact, there really isn't any fancy trademark
> > ooh-aah feature to set python apart.
> 
> I wonder whether Python is hands down the best "glue" language.

I think so.  Let me know if you find a better one.

> I've found Python highly effective (more so than anything
> else I've tried or heard of) at:
> 
>  - calling other programs
>  - text processing
>  - calling DLLs (.so in *nix)
>  - networking (sockets)
>  - GUIs
>  - automated testing
>  - web stuff
>  - specialized areas (e.g. numerical, XML)
>  - probably half a dozen others I forget

Here's a few more:
- code generation
- alternative to embedded microlanguage interpreters
- tiny utility scripts
- huge applications
- hydroponic lobster farming

> With the vast range of Python's applicability, coupled
> with its scalability, maintainability, and productivity,
> I see Python as being very much "ooh-ahh" in terms of 
> its ability to glue together all kinds of things with 
> a single language and with clean results, in short order.

Oh yes, the overall effect is definitely "ooh-ahh".  I was
just commenting that I haven't noticed any specific unique
python features that are "ooh-ahh".

A few weeks after I discovered Python (a few years ago),
I found win32ui and PythonWin, which very definitely made
me say "ooh-ahh", mainly because it demonstrated the ability
to seamlessly wrap a complex (and rather messy) C++ GUI
library (MFC).  I was immediately able to create a Hello
World message box from the PythonWin command line!

   >>> import win32ui
   >>> win32ui.MessageBox("Hello World!")

I don't know if the equivalent has been done in any other
language besides python.

My next "ooh-ahh" occurred when I wanted to open
an OpenGL window in PythonWin.  Apparently this
hadn't ever been done before, since the OpenGL python
wrapper had been developed on *nix (though it wrapped
a portable C++ OpenGL library).  I contacted Mark
Hammond (PythonWin) and David Ascher (OpenGL).
The next morning I had received a patch and had a
seamless working solution.  In fact, I simply cut-and-
pasted a C++ OpenGL spinning cube sample into my
python code (the syntax is the same since semicolons
are optional in python) and it worked!

> Does anything else come even close?

Let me know if you find anything!

- Ken






More information about the Python-list mailing list