>>> test[tmpKey]
Warning (from warnings module):
File "__main__", line 1
UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
test[tmpKey]
KeyError: 'K\xfcndigung'
你好像在用Python2:
在Python2中,
^{pr2}$str
不是unicode,与Python3相反,因此将tmpKey
改为unicode对象:相关问题 更多 >
编程相关推荐