Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Dennis Lee Bieber Newsgroups: comp.lang.python Subject: Re: Pyhon 2.x or 3.x, which is faster? Date: Tue, 08 Mar 2016 21:03:40 -0500 Organization: IISS Elusive Unicorn Lines: 34 Message-ID: References: <56de3513$0$1621$c3e8da3$5496439d@news.astraweb.com> <56df602a$0$1591$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de usjc+aex15TogDWXv2pOYQ1c1N9Ndj1Q4Oy/Vt6uRe6w== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '"w")': 0.09; '101': 0.09; 'input,': 0.09; 'message-id:@4ax.com': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:which': 0.09; 'output': 0.13; 'translate': 0.15; 'wed,': 0.15; '2016': 0.16; '\\r\\n': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'byte': 0.18; 'url:home': 0.18; '>>>': 0.20; '(on': 0.22; 'header:X -Complaints-To:1': 0.26; 'preceding': 0.29; "d'aprano": 0.33; 'steven': 0.33; 'but': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'charset:us-ascii': 0.37; 'skip:o 20': 0.38; 'to:addr:python.org': 0.40; 'mar': 0.65; 'dennis': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: adsl-108-73-116-234.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:104378 On Wed, 09 Mar 2016 10:28:40 +1100, Steven D'Aprano declaimed the following: > >Python will never expand \n to \r\n. But it may translate \r\n to \n. > Not on input, but it will on output (on Windows) >>> fout = open("C:/temp/dummy.txt", "w") >>> fout.write("line1\nline2\n") >>> fout.close() >>> PS C:\temp> get-content -Encoding byte .\dummy.txt 108 105 110 101 49 13 10 108 105 110 101 50 13 10 Note the "13" () preceding the "10" () -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/