Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #93408
| Path | csiph.com!usenet.pasdenom.info!news.redatomik.org!border1.nntp.ams1.giganews.com!border2.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python.list@tim.thechases.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.005 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.05; 'data:': 0.07; 'subject:file': 0.07; 'python': 0.11; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'stdlib.': 0.16; 'subject:download': 0.16; 'true:': 0.16; 'wrote:': 0.16; "i've": 0.24; 'header:In-Reply-To:1': 0.24; 'written': 0.24; 'example': 0.25; 'wonder': 0.27; 'function': 0.30; 'could': 0.35; 'to:addr :python-list': 0.35; 'skip:o 20': 0.35; 'received:10': 0.37; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'to:addr:python.org': 0.39; 'data': 0.40; 'times': 0.61; 'received:46': 0.63; 'otten': 0.84 |
| X-Sender-Id | wwwh|x-authuser|tim@thechases.com |
| X-Sender-Id | wwwh|x-authuser|tim@thechases.com |
| X-MC-Relay | Neutral |
| X-MailChannels-SenderId | wwwh|x-authuser|tim@thechases.com |
| X-MailChannels-Auth-Id | wwwh |
| X-MC-Loop-Signature | 1435781059281:2604403443 |
| X-MC-Ingress-Time | 1435781059280 |
| Date | Wed, 1 Jul 2015 15:04:19 -0500 |
| From | Tim Chase <python.list@tim.thechases.com> |
| To | python-list@python.org |
| Subject | Re: Python 3 resuma a file download |
| In-Reply-To | <mn1gct$nb0$1@ger.gmane.org> |
| References | <9a629cf3-e256-494a-8ff8-3f1f6fc2218c@googlegroups.com> <mailman.204.1435707788.3674.python-list@python.org> <ef677bbd-5b40-40b7-8f56-e6a7d39f9ce0@googlegroups.com> <mailman.219.1435763456.3674.python-list@python.org> <4a7fae78-276e-42c6-9d84-1fddbeb99853@googlegroups.com> <mailman.225.1435778925.3674.python-list@python.org> <36d1cf6d-9b99-4d38-8f07-83443bcd2f60@googlegroups.com> <mn1gct$nb0$1@ger.gmane.org> |
| X-Mailer | Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) |
| Importance | low |
| X-Priority | 4 (Low) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=US-ASCII |
| Content-Transfer-Encoding | 7bit |
| X-AuthUser | tim@thechases.com |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| 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.232.1435805143.3674.python-list@python.org> (permalink) |
| Lines | 22 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1435805143 news.xs4all.nl 2937 [2001:888:2000:d::a6]:55231 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:93408 |
Show key headers only | View raw
On 2015-07-01 21:51, Peter Otten wrote: > use a loop: > > CHUNKSIZE = 16*1024 # for example > while True: > data = response.read(CHUNKSIZE) > if not data: > break > out_file.write(data) > > > This can be simplified: > > shutil.copyfileobj(response, out_file) It's these little corners of Python that make me wonder how many times I've written that `while` loop when I could have just used a tested function from the stdlib. Sigh. -tkc
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Python 3 resuma a file download zljubisic@gmail.com - 2015-06-30 08:34 -0700
Re: Python 3 resuma a file download Cameron Simpson <cs@zip.com.au> - 2015-07-01 09:21 +1000
Re: Python 3 resuma a file download zljubisic@gmail.com - 2015-07-01 07:18 -0700
Re: Python 3 resuma a file download Ian Kelly <ian.g.kelly@gmail.com> - 2015-07-01 09:10 -0600
Re: Python 3 resuma a file download zljubisic@gmail.com - 2015-07-01 12:24 -0700
Re: Python 3 resuma a file download Chris Angelico <rosuav@gmail.com> - 2015-07-02 05:28 +1000
Re: Python 3 resuma a file download zljubisic@gmail.com - 2015-07-01 12:31 -0700
Re: Python 3 resuma a file download Peter Otten <__peter__@web.de> - 2015-07-01 21:51 +0200
Re: Python 3 resuma a file download zljubisic@gmail.com - 2015-07-01 12:59 -0700
Re: Python 3 resuma a file download Peter Otten <__peter__@web.de> - 2015-07-01 22:06 +0200
Re: Python 3 resuma a file download Tim Chase <python.list@tim.thechases.com> - 2015-07-01 15:04 -0500
Re: Python 3 resuma a file download zljubisic@gmail.com - 2015-07-02 13:27 -0700
Re: Python 3 resuma a file download Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2015-07-02 23:31 +0200
Re: Python 3 resuma a file download MRAB <python@mrabarnett.plus.com> - 2015-07-02 23:07 +0100
Re: Python 3 resuma a file download zljubisic@gmail.com - 2015-07-04 22:31 -0700
csiph-web