Warum versteht das Python-Skript kein Unicode?
📁 Python, KI
"
Skript:
#! /usr/bin/env python print ""Привет"" Gibt einen Fehler aus:
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 detailsWas muss hinzugefügt werden, um dem Interpreter mitzuteilen, dass Unicode vorhanden ist?
"
Am Anfang muss ein spezieller Kommentar hinzugefügt werden.
#! /usr/bin/env python# -*- coding: utf-8 -*-print ""Привет""
Anmelden um eine Antwort zu hinterlassen