Bind threads to addresses -- Windows & urllib?

Nick Arnett narnett at mccmedia.com
Wed Sep 4 19:15:01 EDT 2002


> i think you mean something like this:
>
> import thread
>
>
> def spiderStuff(Socket):
>     # do the spider stuff here
>     pass
>
> ...
>
> thread.start_new_thread(SpiderStuff, (,newSocket))

I would like to avoid going to the low-level modules -- I guess I was hoping
for something along the lines of urllib or urllib2 that would have already
have this exposed.  Perhaps I can hack one of them.  It looks to me as
though I could at least hard-code the addresses into my code, then pass them
to a hacked urllib that uses them instead of the localhost and thishost
methods.  Of course, hard-coding the addresses would be very ugly and
non-portable.

Any further thoughts out there?

Nick





More information about the Python-list mailing list