关于打印乱码问题,请教
"gary.jsz" <[email protected]> Sun, 20 Jan 2008 16:36:23 +0800
| Newsgroups | gmane.comp.python.chinese |
|---|---|
| Message-ID | <[email protected]> |
代码如下:
#-*-coding=gb2312-*-
d1 = {1:'中国人', 2:'中国龙',3:'龙芯CPU', 4:'巨蟒'}
print d1
for i in d1.keys():
print i, '\t' ,d1[i]
y = len(d1)
print y
为何只答应d1的时候是下面的这些字符,而佚代后确打印正常,请问为什么?
结果如下:
{1: '\xd6\xd0\xb9\xfa\xc8\xcb', 2: '\xd6\xd0\xb9\xfa\xc1\xfa', 3: '\xc1\xfa\xd0\xbeCPU', 4: '\xbe\xde\xf2\xfe'}
1 中国人
2 中国龙
3 龙芯CPU
4 巨蟒
4
_______________________________________________
python-chinese
Post: send [email protected]
Subscribe: send subscribe to [email protected]
Unsubscribe: send unsubscribe to [email protected]
Detail Info: http://python.cn/mailman/listinfo/python-chinese