[PYTHON] I'm saving in UTF-8 but Syntax Error

It's very basic, but as a reminder.

I'm saving a python file in UTF-8, but sometimes I get a Syntax Error at runtime. Even if it is a comment, it seems to get angry if it comes out if it contains characters outside the ascii range.

In such a case, at the beginning of the file # coding: utf-8 Or #-*- coding: utf-8 -*- It is solved by writing !!

By the way, this is ** python2.x series ** I wasn't angry even if I didn't write the python3.x series, but is it safe to write it?

Recommended Posts

I'm saving in UTF-8 but Syntax Error
Error in random.shuffle
Error in Pyinstaller
Error in TensorBoard
I wrote python3.4 in .envrc with direnv and allowed it, but I got a syntax error
Error handling in PythonBox
zipimporter error in pyramid