Seek in urllib.urlopen()?
Robert Roy
rjroy at takingcontrol.com
Tue Jun 6 22:04:03 EDT 2000
More information about the Python-list mailing list
Tue Jun 6 22:04:03 EDT 2000
- Previous message (by thread): Perl and NT/2000 resources please
- Next message (by thread): Seek in urllib.urlopen()?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, 06 Jun 2000 07:32:22 GMT, thomas at cintra.no (Thomas Weholt) wrote: >Hi, > >I was wondering if you could use some method similar to seek in the >urllib-module. If I want to read just the 256 bytes in the middle of a >file, not read the entire crap in front of those bytes, can I do that, >or do I have to read all the data in front too? > >Thomas >From the documentation for urllib.urlopen( This supports the following methods: read(), readline(), readlines(), fileno(), close(), info() and geturl(). so no seek()... nothing preventing you from doing x = urlopen('http://www.python.org') # read into the file and throw away result x.read(1024) stuffIWant = x.read(256) Bob
- Previous message (by thread): Perl and NT/2000 resources please
- Next message (by thread): Seek in urllib.urlopen()?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list