best text editor for programming Python on a Mac
MRAB
python at mrabarnett.plus.com
Fri Jun 17 20:58:58 EDT 2016
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.
More information about the Python-list
mailing list