Avatar ·

Pourquoi un script Python ne comprend-il pas l'unicode ?

📁 Sujets avancés sur Python, IA

"

Script :

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

Génère une erreur :

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

Que faut-il ajouter pour indiquer à l'interpréteur la présence d'unicode ?

"