Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: MRAB Newsgroups: comp.lang.python Subject: Re: best text editor for programming Python on a Mac Date: Sat, 18 Jun 2016 01:58:58 +0100 Lines: 17 Message-ID: References: <8db734be-a90b-d6db-07e9-75246649cfbf@mrabarnett.plus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de liXp2AkhKL3iXhzVznYXoQvdIejQtcUWpUOU2ixolSgw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:text': 0.04; 'subject:Python': 0.05; '-*-': 0.07; 'subject:editor': 0.07; 'utf-8': 0.07; 'coding:': 0.09; 'encoding.': 0.09; 'non-ascii': 0.09; 'stating': 0.09; 'encoding': 0.15; 'declared;': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:192.168.1.4': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Mac': 0.16; 'subject:programming': 0.16; 'syntaxerror:': 0.16; 'there?': 0.16; 'url:pep-0263': 0.16; 'wrote:': 0.16; 'stick': 0.18; 'ascii': 0.22; 'trying': 0.22; 'second': 0.24; 'tried': 0.24; 'plain': 0.24; 'header:In-Reply-To:1': 0.24; 'script': 0.25; 'header:User- Agent:1': 0.26; 'chris': 0.26; 'error': 0.27; 'specify': 0.27; 'mode.': 0.29; 'url:peps': 0.29; 'character': 0.29; 'getting': 0.33; 'source': 0.33; 'url:python': 0.33; 'message.': 0.33; 'open': 0.33; 'editor': 0.34; 'text': 0.35; 'saved': 0.35; 'url:dev': 0.35; 'something': 0.35; 'but': 0.36; 'should': 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'mac': 0.37; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'still': 0.40; 'details': 0.62; 'world': 0.64; 'python-list': 0.66; 'western': 0.89 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=K//fZHiI c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=IkcTkHD0fZMA:10 a=8AHkEIZyAAAA:8 a=fSeR4aaqTG7fTPxZTDUA:9 a=QEXdDO2ut3YA:10 a=7K4yPEzc-uA7A4xFz8XL:22 X-AUTH: mrabarnett@:2500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <8db734be-a90b-d6db-07e9-75246649cfbf@mrabarnett.plus.com> X-Mailman-Original-References: Xref: csiph.com comp.lang.python:110073 On 2016-06-18 00:52, Chris via Python-list wrote: > I have been trying to write a simple Hello World script on my Mac at work with TextEdit. However, I keep getting this error message: > > SyntaxError: Non-ASCII character '\xe2' in hello_world.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details > > I am using TextEdit in plain text mode. The document was saved in UTF-8, and I still get the error message. I tried switching to Western ASCII encoding, but once I start typing, I get a message stating that the document can no longer be saved using its original Western (ASCII) encoding. > > Any suggestions for a good open source text editor for the Mac out there? For now, I am going to stick with vim. > Did you specify the encoding as described in the PEP? It should be something like: # -*- coding: utf-8 -*- as the first or second line.