473,287 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Re: urlretrieve can't send headers

I have looked in to urllib2, and I can't find a
function which would allow me to get the progress of
the download as it happens, bit by bit, like
urlretrieve does, at least not easily.
urllib.urlretrieve's returnhook is just handy.
I have another question concerning urlretrieve, is
there a way I can force it to stop downloading
half-way, say after the user clicked cancel? Thanks in
advance.

--- "Diez B. Roggisch" <de***@nospam.web.dewrote:
triplezone3 schrieb:
Hello. I'm using urllib.urlretrieve to download
files,
because it provides a handy hook function.
Unfortunately, it won't let me send headers, which
could be quite useful. Is there any way I could do
this?

I suggest you look into urllib2. It allows you to
explicitly create an
request-object that you can stuff with headers and
parameters and what
you like.

diez
--
http://mail.python.org/mailman/listinfo/python-list


__________________________________________________ _________
Yahoo! For Good helps you make a difference

http://uk.promotions.yahoo.com/forgood/
Jun 27 '08 #1
0 941

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: HP | last post by:
I am using urllib.urlretrieve() to download a file from a web site. THe trouble is that the file name has spaces in it, such as "string string1 foo.doc". The statement:...
1
by: Josh | last post by:
Hi. I am writing a script that downloads lots of zips from a usgs site. All is going well except that occasionally, in the midst of downloading a file, the script just hangs and i must either...
6
by: Sven | last post by:
Hi guys and gals, I'm wrestling with the urlretrieve function in the urllib module. I want to download a file from a web server and save it locally with the same name. The problem is the URL -...
1
by: triplezone3 | last post by:
Hello. I'm using urllib.urlretrieve to download files, because it provides a handy hook function. Unfortunately, it won't let me send headers, which could be quite useful. Is there any way I could...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.