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: 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: References: Date: Wed, 23 Jul 2014 09:08:20 -0400 Subject: Re: how to download special range content with requests in python? From: Joel Goldstick To: =?UTF-8?B?5rC06Z2Z5rWB5rex?= <1248283536@qq.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Wed, Jul 23, 2014 at 9:03 AM, Joel Goldstick wrote: > > > > > On Wed, Jul 23, 2014 at 5:44 AM, =E6=B0=B4=E9=9D=99=E6=B5=81=E6=B7=B1 <12= 48283536@qq.com> wrote: >> >> url=3D'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 =3D requests.get(url).read(0,1000) =E2=80=8D >> >> why i can not download special range(from 0 to 10000) content with requ= ests in python=E2=80=8D? > > > I've never heard of anyone reading an iso file with requests. I'm guessi= ng 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 --=20 Joel Goldstick http://joelgoldstick.com