[Tutor] Proxy

Ashkan Aliabadi master_knight at fastmail.fm
Wed Aug 18 14:01:54 CEST 2004


Hi folks!!

Our university doesn't have wget installed on UNIX systems, so
as a good programming practice, I managed to write it myself. As
you know, it's quite simple, all it needs is a call to
urllib.urlretrieve(urladdress). I added some featuers indeed,
but there are two things I'm stuck in! First, we have proxy
servers here, and I don't know how to transfer data through them
?!! How can i make my prog to transfer data through proxy
servers ?!!!! As my prog works all right with direct internet
access, but when there are proxies in between it's a real mess.
Secondly, how on Earth can I make it work in the background? I
though a simple call to thread.start_new_thread(function,args)
would do the trick (as it's the case when you are running the
prog in the interpreter line by line ) but when I'm about to run
it from command line, it seems as my program finishes before the
new thread catches the file from the internet, if you know what
I mean ;D. Here is the code:
imoprt thread, urllib
thread.start_new_thread(urllib.urlretrieve,('http://www.python.org',))
#Not enough time to download the file, the program finishes before the th
read is done!!! At least thats what I think.
I'd be greatful if you folks could help
have a nice day,
Ashkan(master_knight at fastmail.fm)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20040818/d33aa155/attachment.html


More information about the Tutor mailing list