Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(at': 0.04; 'output': 0.05; 'subject:file': 0.07; 'bytes.': 0.09; 'omit': 0.09; 'subject:into': 0.09; 'windows,': 0.09; 'subject:How': 0.10; 'python': 0.11; 'carriage': 0.16; 'cmp': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'inversion': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'outputs': 0.16; 'preserved': 0.16; 'subject:python': 0.16; 'files.': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'entered': 0.20; '>>>': 0.22; 'python?': 0.22; 'creating': 0.23; 'header:User-Agent:1': 0.23; 'guys': 0.24; 'file.': 0.24; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'skip:- 40': 0.29; '[1]': 0.29; 'mode': 0.30; 'code': 0.31; 'routine': 0.31; 'file': 0.32; 'date:': 0.34; 'something': 0.35; 'really': 0.36; 'doing': 0.36; 'subject:?': 0.36; 'email addr:python.org': 0.37; 'writes': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'subject:': 0.39; 'to:addr:python.org': 0.39; 'according': 0.40; 'how': 0.40; 're:': 0.63; 'email name:python- list': 0.65; 'header:Reply-To:1': 0.67; 'url:pdf': 0.68; 'reply- to:no real name:2**0': 0.71; 'acorn': 0.84; 'reply- to:addr:python.org': 0.84; 'carlos': 0.91; 'mistake': 0.91; '2013': 0.98 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=TZ6v63gh c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=oyR3mlnJdzkA:10 a=WRpOptpJu3kA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=Sxr0_q1KlCAA:10 a=IdtVdNE8AAAA:8 a=jMVC_T0eHyZHnB-W4foA:9 a=wPNLvfGTeEIA:10 a=VhVvL8HfBcoA:10 X-AUTH: mrabarnett:2500 Date: Sun, 19 May 2013 16:44:55 +0100 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: python-list@python.org Subject: Re: How to write fast into a file in python? References: , , <87f9a3d4-427e-472f-bee7-9501ba842b36@googlegroups.com>, , <51961B73.2070401@davea.name>, , , , <51966d15$0$29997$c3e8da3$5496439d@news.astraweb.com>, , , , , , <51983BDC.1060203@davea.name> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: python-list@python.org 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: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1368978295 news.xs4all.nl 15878 [2001:888:2000:d::a6]:57779 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45563 On 19/05/2013 04:53, Carlos Nepomuceno wrote: > ---------------------------------------- >> Date: Sat, 18 May 2013 22:41:32 -0400 >> From: davea@davea.name >> To: python-list@python.org >> Subject: Re: How to write fast into a file in python? >> >> On 05/18/2013 01:00 PM, Carlos Nepomuceno wrote: >>> Python really writes '\n\r' on Windows. Just check the files. >> >> That's backwards. '\r\n' on Windows, IF you omit the b in the mode when >> creating the file. > > Indeed! My mistake just made me find out that Acorn used that inversion on Acorn MOS. > > According to this[1] (at page 449) the OSNEWL routine outputs '\n\r'. > > What the hell those guys were thinking??? :p > Doing it that way saved a few bytes. Code was something like this: FFE3 .OSASCI CMP #&0D FFE5 BNE OSWRCH FFE7 .OSNEWL LDA #&0A FFE9 JSR OSWRCH FFEC LDA #&0D FFEE .OSWRCH ... This means that the contents of the accumulator would always be preserved by a call to OSASCI. > "OSNEWL > This call issues an LF CR (line feed, carriage return) to the currently selected > output stream. The routine is entered at &FFE7." > > [1] http://regregex.bbcmicro.net/BPlusUserGuide-1.07.pdf >