Threads with Python?

Peter Hansen peter at engcorp.com
Mon Dec 30 21:06:53 EST 2002


Fernando wrote:
> 
> I have a small python app that would benefit from using threads (it
> fetches info from several web servers). Does python support this? I
> checked my copy of Learning Python, but it doesn't mention it...

You might consider, in addition the other responses pointing
you to the standard threading support, looking into how asynchronous
socket-based applications function.  There is a module called medusa
(asyncore and asynchat) in the standard library now, in addition to
a sophisticated framework called Twisted (google can help you here)
which will let you do what you want *without* threads, with likely
simpler code and better performance overall (which may or may not
be an issue for you).  

Just letting you know there are other ways to approach this.

-Peter



More information about the Python-list mailing list