Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #27778
| Path | csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | Marco <marco_u@nsgmail.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: Built-in open() with buffering > 1 |
| Date | Fri, 24 Aug 2012 07:21:36 +0200 |
| Organization | Aioe.org NNTP Server |
| Lines | 21 |
| Message-ID | <k1730u$466$1@speranza.aioe.org> (permalink) |
| References | <k170ae$vbe$1@speranza.aioe.org> |
| NNTP-Posting-Host | jkLVTVqcLfHLY4STqRGQsQ.user.speranza.aioe.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Complaints-To | abuse@aioe.org |
| User-Agent | Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 |
| X-Notice | Filtered by postfilter v. 0.8.2 |
| Xref | csiph.com comp.lang.python:27778 |
Show key headers only | View raw
On 08/24/2012 06:35 AM, Marco wrote:
> Please, can anyone explain me the meaning of the
> "buffering > 1" in the built-in open()?
> The doc says: "...and an integer > 1 to indicate the size
> of a fixed-size chunk buffer."
Sorry, I get it:
>>> f = open('myfile', 'w', buffering=2)
>>> f._CHUNK_SIZE = 5
>>> for i in range(6):
... n = f.write(str(i))
... print(i, open('myfile').read(), sep=':')
...
0:
1:
2:
3:
4:
5:012345
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Built-in open() with buffering > 1 Marco <marco_u@nsgmail.com> - 2012-08-24 06:35 +0200
Re: Built-in open() with buffering > 1 Marco <marco_u@nsgmail.com> - 2012-08-24 07:21 +0200
Re: Built-in open() with buffering > 1 Ramchandra Apte <maniandram01@gmail.com> - 2012-08-24 07:32 -0700
Re: Built-in open() with buffering > 1 Hans Mulder <hansmu@xs4all.nl> - 2012-08-26 10:25 +0200
Re: Built-in open() with buffering > 1 Marco <marco_u@nsgmail.com> - 2012-08-30 17:39 +0200
csiph-web