Before I go with python ...

Alex Martelli alex at magenta.com
Thu Dec 30 03:04:54 EST 1999


Andrew Csillag writes:

> > Is it possible to have assynchronous I/O,
> > for example continuing a program while
> > another task is wainting on a socket?
> > 
> > How is taht achieved? Multithread? Just
> > a call after the socket has data?
> > 
> Your choice.  Python can do threads, and if you are on Unix (maybe
> windows, but I don't know) you can also use the select module.  With the

Python threads do work on Windows (with the standard distribution), 
and select too, but the latter, I believe, only on sockets (not files &c).

Maybe the "asyncore" could also work?  Haven't looked into it yet...
async sockets would seem to be the 'mainstream' on Windows (i.e.,
with the Winsock library -- although you can ask it for blocking
sockets too, the async variety feeds window messages into your
main window message loop -- smoothest and most efficient for a
program that is organized in the normal Windows way).


Alex






More information about the Python-list mailing list