[Tutor] Hook (Urlretrieve)

Øyvind python at kapitalisten.no
Sun Aug 29 19:29:50 CEST 2004


Hello,

   I have a few thousand objects I would like to retrieve from the web and
store locally. Is urllib.urlretrieve the most efficient way to do so?

   In the documentation to Python it is mentioned that the urlretrieve
have a hook function. As I understand that function can provide the
info about the size and blocks transfered. How do I use that hook
function? I would like to present a counter that shows how far in the
process with the downloading it is. But, as far as I have seen, there
is no info on how to use that hook. The closest I found was
PyCCmdTarget.HookCommand and its description. But to be honest, I
didn't understand at all what, how or if this is related, and how I can
use it. A search in my Pythonbooks as well as Google proved fruitless.
Is there some way to explain hooks in a simple way? Or does anyone have
some simple examples of how it may be used?

Thanks in advance...

-- 
This email has been scanned for viruses & spam by Decna as - www.decna.no
Denne E-post er sjekket for virus & spam av Decna as - www.decna.no



More information about the Tutor mailing list