Re: Download the "head" of a large file?

2009-07-27 Thread Ben Charrow
Dennis Lee Bieber wrote: On Mon, 27 Jul 2009 13:38:25 -0700 (PDT), erikcw declaimed the following in gmane.comp.python.general: Something like the Python equivalent of curl http://url.com/file.xml | head -c 2048 Presuming that | is a shell pipe operation, then doesn't that command lin

Re: Download the "head" of a large file?

2009-07-27 Thread Gabriel Genellina
En Mon, 27 Jul 2009 19:40:25 -0300, John Yeung escribió: On Jul 27, 4:38 pm, erikcw wrote: I'm trying to figure out how to download just the first few lines of a large (50mb) text file form a server to save bandwidth.  Can Python do this? Something like the Python equivalent of curlhttp://ur

Re: Download the "head" of a large file?

2009-07-27 Thread John Yeung
On Jul 27, 4:38 pm, erikcw wrote: > I'm trying to figure out how to download just the first few lines of a > large (50mb) text file form a server to save bandwidth.  Can Python do > this? > > Something like the Python equivalent of curlhttp://url.com/file.xml| > head -c 2048 urllib.urlopen gives

Re: Download the "head" of a large file?

2009-07-27 Thread Ben Charrow
erikcw wrote: > ...download just the first few lines of a large (50mb) text file form a > server to save bandwidth. Something like the Python equivalent of curl > http://url.com/file.xml | head -c 2048 If you're OK calling curl and head from within python: from subprocess import Popen, PIPE u

Download the "head" of a large file?

2009-07-27 Thread erikcw
I'm trying to figure out how to download just the first few lines of a large (50mb) text file form a server to save bandwidth. Can Python do this? Something like the Python equivalent of curl http://url.com/file.xml | head -c 2048 Thanks! Erik -- http://mail.python.org/mailman/listinfo/python-l