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


Groups > comp.lang.python > #75085

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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <joel.goldstick@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.021
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'arguments': 0.09; 'cc:addr :python-list': 0.11; '23,': 0.16; 'code?': 0.16; 'guessing': 0.16; 'subject:download': 0.16; 'subject:requests': 0.16; 'url:debian': 0.16; 'url:iso': 0.16; 'subject:python': 0.16; 'size,': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'work,': 0.20; 'import': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; "i've": 0.25; 'url:edu': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'requests': 0.31; 'large.': 0.31; 'anyone': 0.31; 'file': 0.32; 'probably': 0.32; 'run': 0.32; 'quite': 0.32; 'url:python': 0.33; 'subject:with': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'url:listinfo': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'two': 0.37; 'heard': 0.39; 'url:mail': 0.40; 'url:0': 0.67; 'skip:r 30': 0.69; 'jul': 0.74; 'special': 0.74; '\xe2\x80\x8d': 0.84; 'joel': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=rKeZez+JnRfwKmcgmSdpjUoAriwT/pSgS4SHVC+dhK0=; b=qihtC1oz8gkYCnRAvCNXu9vzxoIytsnW/+ooyKsdaZxNB+4290+UJvlemrJ87HQNMI 8Z8DluJKfkg3KZy1RdWiUAK5MDn13sr4Pxy3DUJD7n1gjbxBHnRS3bnRyXqgO4R0iNtF Hh5BnkXrJG1a5YuBNEv2BJRs1aYlnloELHYjUpz3rqDTGg5sUTuKn95Oj8ARaqN0q4l1 9YeyF6IqY872VR0cVWwKIugCdUgwc800ujUW3DNw4ZHDZM44Lah1SOKvI84s/9iXriE+ IYoUY/ejnfaFrGemTxRWuByTwfTls5H4vcpX6dJn4We8Mp4NoyBDySngeJsfsnGe9NYR zKpA==
MIME-Version 1.0
X-Received by 10.220.69.68 with SMTP id y4mr1828020vci.21.1406120900225; Wed, 23 Jul 2014 06:08:20 -0700 (PDT)
In-Reply-To <CAPM-O+znn6RSTfcYwaQ6L3NYKBZCYAnkJCeyG0rGJLmDPhG6SQ@mail.gmail.com>
References <tencent_11DB8BA910751CAB361D6B09@qq.com> <CAPM-O+znn6RSTfcYwaQ6L3NYKBZCYAnkJCeyG0rGJLmDPhG6SQ@mail.gmail.com>
Date Wed, 23 Jul 2014 09:08:20 -0400
Subject Re: how to download special range content with requests in python?
From Joel Goldstick <joel.goldstick@gmail.com>
To 水静流深 <1248283536@qq.com>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
Cc python-list <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.12240.1406120904.18130.python-list@python.org> (permalink)
Lines 48
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1406120904 news.xs4all.nl 2864 [2001:888:2000:d::a6]:40060
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:75085

Show key headers only | View raw


On Wed, Jul 23, 2014 at 9:03 AM, Joel Goldstick
<joel.goldstick@gmail.com> wrote:
>
>
>
>
> On Wed, Jul 23, 2014 at 5:44 AM, 水静流深 <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‍?
>
>
> I've never heard of anyone reading an iso file with requests.  I'm guessing it will work, but it is probably quite large.
>
> What actually happens when you run your code?


Also:
file.read([size])

a file object can take a size, but not two arguments aparently



>>
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
>
>
> --
> Joel Goldstick
> http://joelgoldstick.com




-- 
Joel Goldstick
http://joelgoldstick.com

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: how to download special range content with requests in python? Joel Goldstick <joel.goldstick@gmail.com> - 2014-07-23 09:08 -0400

csiph-web