Download the "head" of a large file?

erikcw erikwickstrom at gmail.com
Mon Jul 27 16:38:25 EDT 2009


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



More information about the Python-list mailing list