python运行异常

异常信息:

UnicodeEncodeError: 'UCS-2' codec can't encode characters in position 82-82: Non-BMP character not supported in Tk

 解决方法:在代码前加入:

non_bmp_map = dict.fromkeys(range(0x10000, sys.maxunicode + 1), 0xfffd)

异常信息:greet是个类名 在greet = greet(),在for循环实例化时第二次会出现这个异常。

TypeError: 'greet' object is not callable

解决方法:

因为我变量名和函数名写重复,修改:g = greet()