Newbie switching from TCL

Cameron Laird claird at starbase.neosoft.com
Mon Aug 21 00:44:15 EDT 2000


In article <8nornc$1li$1 at slb3.atl.mindspring.net>,
Aahz Maruch <aahz at netcom.com> wrote:
>In article <8noo7c$4et$1 at news.online.de>,
>Henning Hanusa <henning at 3s-hanusa.de> wrote:
>>
>>I need some help/hints, because obviously I missed something in
>>event-handling!?
>
>Tcl does do event-handling more elegantly than Python.  In Python, you
>need to use threads to do the same thing (generally speaking; there are
>other ways, but they usually require more work).  Take a look at the
>"threading" module; if that's not clear, come back and we'll give you
>some more help.
			.
			.
			.
This topic interests me, so I'll elaborate just a bit.

I'm very fond of event processing, and Tcl's, in particular.
I argue that it has a lot to offer, and other languages should
learn from it.  Guido and other insiders have studied Tcl's
event handling, of course, and they're thinking of ways to re-
use some of its ideas.

At the same time, Tcl is relatively isolated as a language in
its emphasis of event handling.  Most prominent languages today
promote threading as a multi-processing mechanism.  This popu-
larity in itself constitutes an argument for Python's threading.

In any case, part of the other-than-Tcl style is not to concede
event handling has a unified equivalent.  I don't understand Mr.
Hanusa's description of his situation.  My guess, though, is
that he's working with some sort of socket-based networking
service.  Python answers generally with specific modules for
socket communications.  Rather than trying to emulate [vwait]
in Python so that one can interpret old Tcl designs, it's
better to rewrite in terms of select() or higher-level socket-
savvy functionality.

And if you have a certain kind of good taste, you'll realize
that co-routines are the *really* cool opportunity, and you'll
want to jump into Stackless Python <URL:http://
starbase.neosoft.com/~claird/comp.lang.python/python_varieties.html#Stackless>.
to 

  in Tcl I can use "trave" /and/or "vwait" to do eventhandling. reading the
  python "try", I understand, that in case of
  an event EVERY processing is stop, and the corresponding exception is being
  processed.

  Does that mean, that there can not be more than one running proc, processing
  different events?

-- 

Cameron Laird <claird at NeoSoft.com>
Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html



More information about the Python-list mailing list