Avatar ·

Why doesn't the Python script understand Unicode?

📁 Advanced Python Topics, AI

"

Script:

#! /usr/bin/env python    print ""Привет"" 

Gives an error:

File ""./y.sh"", line 2  SyntaxError: Non-ASCII character '\\xd0' in file ./y.sh on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

What do I need to add to tell the interpreter about the presence of Unicode?

"