event loops and Python?

Just van Rossum just at letterror.com
Sun Mar 12 05:50:08 EST 2000


Donn Cave wrote:
> 
> Quoth kragen at dnaco.net (Kragen Sitaker):
> [re dispatching via Tk]
> | Sorry, I meant, "This is bad if you're not running in a graphical
> | environment."  I want to build an event-driven tty application.
> |
> | I guess I should start looking at how Tkinter does it :)
> 
> An application whose events are I/O, like X applications, can use
> select().  (On UNIX, anyway - platforms that tack on the Berkeley
> socket API but don't get the file descriptor concept are likely
> to support select() only on sockets.)  Hope that helps, I missed
> the original post.

And if you go for select(), be sure to have a look at asyncore.py in the
std distribution. It's an excellent framework for async sockets (and
files if applicable, as Donn said).

Just



More information about the Python-list mailing list