在python 2.7中处理非ascii字符

时间:2019-05-02 20:05:20

标签: python-2.7

当我尝试在python 2.7中处理'æøå'时,会引发错误

# coding: utf-8
q = raw_input("Please enter a word: ")
print q

我原以为是“æøå”,但得到了:

Traceback (most recent call last):
  File "Testing.py", line 2, in <module>
    q = input("Please enter a word: ")
  File "<string>", line 1
    æøå
    ^
SyntaxError: invalid syntax

0 个答案:

没有答案
相关问题