Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75122 > unrolled thread

回复: how to download special range content with requests in python?

Started by"水静流深" <1248283536@qq.com>
First post2014-07-24 11:21 +0800
Last post2014-07-24 11:21 +0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  回复: how to download special range content with requests in python? "水静流深" <1248283536@qq.com> - 2014-07-24 11:21 +0800

#75122 — 回复: how to download special range content with requests in python?

From"水静流深" <1248283536@qq.com>
Date2014-07-24 11:21 +0800
Subject回复: how to download special range content with requests in python?
Message-ID<mailman.12264.1406178169.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

i want to write a multiple threads download program to practice my  MT knowledge, 
1)cut the big iso file into 20 parts
2)start 20 process with threading and queue module to download
3)combine the 20 parts into one iso file.

if i have cut it into 20 parts ,how can i download the first part of it ?

it is target to practice the threading and queue module .  ‍


------------------ 原始邮件 ------------------
发件人: "Chris Angelico";<rosuav@gmail.com>;
发送时间: 2014年7月23日(星期三) 晚上11:58
收件人: 
抄送: "python-list"<python-list@python.org>; 
主题: Re: how to download special range content with requests in python?



On Wed, Jul 23, 2014 at 7:44 PM, 水静流深 <1248283536@qq.com> wrote:
> url='http://debian.cites.illinois.edu/pub/debian-cd/7.6.0/amd64/iso-cd/debian-7.6.0-amd64-CD-1.iso'
> import requests
> r = requests.get(url).read(0,1000)  ‍
>
> why i can not download special range(from 0 to 10000)  content with requests
> in python‍?

Looking into my crystal ball, I think you're trying to have this send
the Range header. If that's the case, then there's no way you can do
that with the read() method; you have to incorporate that into the
original request, and then just read everything the server sends you.

If that's not what you're talking about, please explain further,
preferably demonstrating what you want to happen at the HTTP level.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web