Re: download x bytes at a time over network

2009-03-17 Thread Matt Nordhoff
Saurabh wrote: > Heres the reason behind wanting to get chunks at a time. > Im actually retrieving data from a list of RSS Feeds and need to > continuously check for latest posts. > But I dont want to depend on Last-Modified header or the pubDate tag > in . Because a lot of feeds just output date('

Re: download x bytes at a time over network

2009-03-17 Thread Gabriel Genellina
En Tue, 17 Mar 2009 17:09:35 -0200, R. David Murray escribió: Jean-Paul Calderone wrote: On Tue, 17 Mar 2009 15:17:56 + (UTC), "R. David Murray" wrote: >Jean-Paul Calderone wrote: >> On Tue, 17 Mar 2009 12:15:23 +0530, Saurabh wrote: >> > >> >It seems to have some header like the

Re: download x bytes at a time over network

2009-03-17 Thread R. David Murray
Jean-Paul Calderone wrote: > On Tue, 17 Mar 2009 15:17:56 + (UTC), "R. David Murray" > wrote: > >Jean-Paul Calderone wrote: > >> On Tue, 17 Mar 2009 12:15:23 +0530, Saurabh wrote: > >> >> This isn't exactly how things work.  The server *sends* you bytes.  It > >> >> can > >> >> send you a

Re: download x bytes at a time over network

2009-03-17 Thread Jean-Paul Calderone
On Tue, 17 Mar 2009 15:17:56 + (UTC), "R. David Murray" wrote: Jean-Paul Calderone wrote: On Tue, 17 Mar 2009 12:15:23 +0530, Saurabh wrote: >> This isn't exactly how things work.  The server *sends* you bytes.  It can >> send you a lot at once.  To some extent you can control how much i

Re: download x bytes at a time over network

2009-03-17 Thread n . s . buttar
http://code.activestate.com/recipes/114217/ On Tue, Mar 17, 2009 at 1:38 PM, Saurabh wrote: > Heres the reason behind wanting to get chunks at a time. > Im actually retrieving data from a list of RSS Feeds and need to > continuously check for latest posts. > But I dont want to depend on Last-Modi

Re: download x bytes at a time over network

2009-03-17 Thread R. David Murray
Jean-Paul Calderone wrote: > On Tue, 17 Mar 2009 12:15:23 +0530, Saurabh wrote: > >> This isn't exactly how things work.  The server *sends* you bytes.  It can > >> send you a lot at once.  To some extent you can control how much it sends > >> before it waits for you to catch up, but you don't ha

Re: download x bytes at a time over network

2009-03-17 Thread Jean-Paul Calderone
On Tue, 17 Mar 2009 12:15:23 +0530, Saurabh wrote: This isn't exactly how things work.  The server *sends* you bytes.  It can send you a lot at once.  To some extent you can control how much it sends before it waits for you to catch up, but you don't have anywhere near byte-level control (you mi

Re: download x bytes at a time over network

2009-03-17 Thread Jorgen Grahn
On Tue, 17 Mar 2009 13:38:31 +0530, Saurabh wrote: > Heres the reason behind wanting to get chunks at a time. > Im actually retrieving data from a list of RSS Feeds and need to > continuously check for latest posts. > But I dont want to depend on Last-Modified header or the pubDate tag > in . Beca

Re: download x bytes at a time over network

2009-03-17 Thread R. David Murray
Saurabh wrote: > > This isn't exactly how things work.  The server *sends* you bytes.  It can > > send you a lot at once.  To some extent you can control how much it sends > > before it waits for you to catch up, but you don't have anywhere near > > byte-level control (you might have something lik

Re: download x bytes at a time over network

2009-03-17 Thread Saurabh
Heres the reason behind wanting to get chunks at a time. Im actually retrieving data from a list of RSS Feeds and need to continuously check for latest posts. But I dont want to depend on Last-Modified header or the pubDate tag in . Because a lot of feeds just output date('now') instead of the act

Re: download x bytes at a time over network

2009-03-17 Thread Steven D'Aprano
Please excuse my replying to a reply instead of the original, but the original doesn't show up on my news feed. On 2009/3/16 Saurabh : > I want to download content from the net - in chunks of x bytes or > characters at a time - so that it doesnt pull the entire content in one > shot. > > import

Re: download x bytes at a time over network

2009-03-17 Thread n . s . buttar
2009/3/16 Saurabh : > I want to download content from the net - in chunks of x bytes or characters > at a time - so that it doesnt pull the entire content in one shot. > > import urllib2 > url = "http://python.org/"; > handler = urllib2.urlopen(url) > > data = handler.read(100) > print """Content :

Re: download x bytes at a time over network

2009-03-16 Thread Saurabh
> This isn't exactly how things work.  The server *sends* you bytes.  It can > send you a lot at once.  To some extent you can control how much it sends > before it waits for you to catch up, but you don't have anywhere near > byte-level control (you might have something like 32kb or 64kb level > c

Re: download x bytes at a time over network

2009-03-16 Thread Jean-Paul Calderone
On Mon, 16 Mar 2009 13:02:07 +0530, Saurabh wrote: I want to download content from the net - in chunks of x bytes or characters at a time - so that it doesnt pull the entire content in one shot. This isn't exactly how things work. The server *sends* you bytes. It can send you a lot at once.

download x bytes at a time over network

2009-03-16 Thread Saurabh
I want to download content from the net - in chunks of x bytes or characters at a time - so that it doesnt pull the entire content in one shot. import urllib2 url = "http://python.org/"; handler = urllib2.urlopen(url) data = handler.read(100) print """Content :\n%s \n%s \n%s""" % ('=' * 100, data