Python论坛  - 讨论区

标题:[python-chinese] 关于打印乱码问题,请教

2008年01月20日 星期日 16:36

gary.jsz gary.jsz在gmail.com
星期日 一月 20 16:36:23 HKT 2008

´úÂëÈçÏ£º
#-*-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
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080120/75a9d0bb/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月20日 星期日 16:51

Handle.Huang handle.huang0409在gmail.com
星期日 一月 20 16:51:51 HKT 2008

PythonÄÚ²¿¶¼ÊÇ°´ÕÕUncodeÀ´´¦ÀíµÄ¡£

 

·¢¼þÈË: python-chinese-bounces在lists.python.cn
[mailto:python-chinese-bounces在lists.python.cn] ´ú±í gary.jsz
·¢ËÍʱ¼ä: 2008Äê1ÔÂ20ÈÕ 16:36
ÊÕ¼þÈË: python-chinese在lists.python.cn
Ö÷Ìâ: [python-chinese] ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì

 

´úÂëÈçÏ£º

#-*-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

-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080120/35134ac3/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月20日 星期日 17:19

gary.jsz gary.jsz在gmail.com
星期日 一月 20 17:19:59 HKT 2008

ÓÐʲô·½·¨¿ÉÒÔÈÃËûÖ±½Ó´òÓ¡ÖÐÎÄÂ




·¢¼þÈË£º Handle.Huang
·¢ËÍʱ¼ä£º 2008-01-20 16:52:10
ÊÕ¼þÈË£º python-chinese在lists.python.cn
³­ËÍ£º 
Ö÷Ì⣺ [python-chinese] ´ð¸´: ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì

PythonÄÚ²¿¶¼ÊÇ°´ÕÕUncodeÀ´´¦ÀíµÄ¡£
 
·¢¼þÈË: python-chinese-bounces在lists.python.cn [mailto:python-chinese-bounces在lists.python.cn] ´ú±í gary.jsz
·¢ËÍʱ¼ä: 2008Äê1ÔÂ20ÈÕ 16:36
ÊÕ¼þÈË: python-chinese在lists.python.cn
Ö÷Ìâ: [python-chinese] ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì
 
´úÂëÈçÏ£º
#-*-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
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080120/254bc7e8/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月20日 星期日 18:59

大郎 iexper在gmail.com
星期日 一月 20 18:59:47 HKT 2008

¾ÝÎҵľ­ÑéÊǵ±Ç°ÎļþʹÓÃutf-8±àÂ룬²»»á³öÏÖÎÊÌ⣬²»ÖªÄãÊÇÔÚÃüÁîÐÐÏ»¹ÊÇwebÏ£¿

On 1/20/08, gary.jsz <gary.jsz在gmail.com> wrote:
>
>  ÓÐʲô·½·¨¿ÉÒÔÈÃËûÖ±½Ó´òÓ¡ÖÐÎÄÂ
>
>  ------------------------------
>  *·¢¼þÈË£º* Handle.Huang
> *·¢ËÍʱ¼ä£º* 2008-01-20 16:52:10
> *ÊÕ¼þÈË£º* python-chinese在lists.python.cn
> *³­ËÍ£º*
> *Ö÷Ì⣺* [python-chinese] ´ð¸´: ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì
>
>
> PythonÄÚ²¿¶¼ÊÇ°´ÕÕUncodeÀ´´¦ÀíµÄ¡£
>
>
>
> *·¢¼þÈË:* python-chinese-bounces在lists.python.cn [mailto:
> python-chinese-bounces在lists.python.cn] *´ú±í *gary.jsz
> *·¢ËÍʱ¼ä:* 2008Äê1ÔÂ20ÈÕ 16:36
> *ÊÕ¼þÈË:* python-chinese在lists.python.cn
> *Ö÷Ìâ:* [python-chinese] ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì
>
>
>
> ´úÂëÈçÏ£º
>
> #-*-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 python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>



-- 
http://del.icio.us/iexper
http://twitter.com/qichangxing
http://webpy.org
http://blog.hi0791.com (build with web.py)
http://www.baicai.com °Ù²ÅÕÐƸ
Gtalk: iexper(at)gmail.com
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080120/fa154dee/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月20日 星期日 20:46

gary.jsz gary.jsz在gmail.com
星期日 一月 20 20:46:33 HKT 2008

ÎÒÊÇʹÓÃUlipadÖ±½ÓÔËÐеģ¬ÔËÐнá¹û¾ÍÊÇÕâ¸ö¡£
Èç¹ûÎÒʹÓÃutf8µÄ»°£¬ËùÓеÄÊä³ö¶¼ÎÞ·¨ÏÔʾÖÐÎÄ£¬Ê¹ÓÃgb2312»¹Ö»ÊÇÖ±½Ó´òÓ¡µÄ»áÕâÑù¡£




·¢¼þÈË£º ´óÀÉ
·¢ËÍʱ¼ä£º 2008-01-20 19:00:04
ÊÕ¼þÈË£º python-chinese在lists.python.cn
³­ËÍ£º 
Ö÷Ì⣺ Re: [python-chinese]´ð¸´: ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì

¾ÝÎҵľ­ÑéÊǵ±Ç°ÎļþʹÓÃutf-8±àÂ룬²»»á³öÏÖÎÊÌ⣬²»ÖªÄãÊÇÔÚÃüÁîÐÐÏ»¹ÊÇwebÏ£¿


On 1/20/08, gary.jsz <gary.jsz在gmail.com> wrote: 
ÓÐʲô·½·¨¿ÉÒÔÈÃËûÖ±½Ó´òÓ¡ÖÐÎÄÂ




·¢¼þÈË£º Handle.Huang
·¢ËÍʱ¼ä£º 2008-01-20 16:52:10
ÊÕ¼þÈË£º python-chinese在lists.python.cn 
³­ËÍ£º 
Ö÷Ì⣺ [python-chinese] ´ð¸´: ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì

PythonÄÚ²¿¶¼ÊÇ°´ÕÕUncodeÀ´´¦ÀíµÄ¡£ 

·¢¼þÈË: python-chinese-bounces在lists.python.cn [mailto:python-chinese-bounces在lists.python.cn] ´ú±í gary.jsz
·¢ËÍʱ¼ä: 2008Äê1ÔÂ20ÈÕ 16:36
ÊÕ¼þÈË: python-chinese在lists.python.cn
Ö÷Ìâ: [python-chinese] ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì

´úÂëÈçÏ£º
#-*-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 python-chinese在lists.python.cn
Subscribe: send subscribe to python-chinese-request在lists.python.cn
Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
Detail Info: http://python.cn/mailman/listinfo/python-chinese




-- 
http://del.icio.us/iexper
http://twitter.com/qichangxing 
http://webpy.org
http://blog.hi0791.com (build with web.py)
http://www.baicai.com °Ù²ÅÕÐƸ
Gtalk: iexper(at)gmail.com 
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080120/db8e01a3/attachment-0001.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月20日 星期日 20:51

Handle.Huang handle.huang0409在gmail.com
星期日 一月 20 20:51:44 HKT 2008

Ö±½ÓÔÚcmdÖÐÔËÐÐÄØ£¿

 

·¢¼þÈË: python-chinese-bounces在lists.python.cn
[mailto:python-chinese-bounces在lists.python.cn] ´ú±í gary.jsz
·¢ËÍʱ¼ä: 2008Äê1ÔÂ20ÈÕ 20:47
ÊÕ¼þÈË: python-chinese在lists.python.cn
Ö÷Ìâ: Re: [python-chinese] ´ð¸´: ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì

 

ÎÒÊÇʹÓÃUlipadÖ±½ÓÔËÐеģ¬ÔËÐнá¹û¾ÍÊÇÕâ¸ö¡£

Èç¹ûÎÒʹÓÃutf8µÄ»°£¬ËùÓеÄÊä³ö¶¼ÎÞ·¨ÏÔʾÖÐÎÄ£¬Ê¹ÓÃgb2312»¹Ö»ÊÇÖ±½Ó´òÓ¡µÄ»áÕâ
Ñù¡£

 

  _____  

·¢¼þÈË£º ´óÀÉ

·¢ËÍʱ¼ä£º 2008-01-20 19:00:04

ÊÕ¼þÈË£º python-chinese在lists.python.cn

³­ËÍ£º 

Ö÷Ì⣺ Re: [python-chinese]´ð¸´: ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì

 

¾ÝÎҵľ­ÑéÊǵ±Ç°ÎļþʹÓÃutf-8±àÂ룬²»»á³öÏÖÎÊÌ⣬²»ÖªÄãÊÇÔÚÃüÁîÐÐÏ»¹ÊÇweb
Ï£¿

On 1/20/08, gary.jsz <gary.jsz在gmail.com> wrote: 

ÓÐʲô·½·¨¿ÉÒÔÈÃËûÖ±½Ó´òÓ¡ÖÐÎÄÂ

 

  _____  

·¢¼þÈË£º Handle.Huang

·¢ËÍʱ¼ä£º 2008-01-20 16:52:10

ÊÕ¼þÈË£º python-chinese在lists.python.cn 

³­ËÍ£º 

Ö÷Ì⣺ [python-chinese] ´ð¸´: ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì

 

PythonÄÚ²¿¶¼ÊÇ°´ÕÕUncodeÀ´´¦ÀíµÄ¡£ 

 

·¢¼þÈË: python-chinese-bounces在lists.python.cn
[mailto:python-chinese-bounces在lists.python.cn] ´ú±í gary.jsz
·¢ËÍʱ¼ä: 2008Äê1ÔÂ20ÈÕ 16:36
ÊÕ¼þÈË: python-chinese在lists.python.cn
Ö÷Ìâ: [python-chinese] ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì

 

´úÂëÈçÏ£º

#-*-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 python-chinese在lists.python.cn
Subscribe: send subscribe to python-chinese-request在lists.python.cn
Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
Detail Info: http://python.cn/mailman/listinfo/python-chinese




-- 
http://del.icio.us/iexper
http://twitter.com/qichangxing  <http://twitter.com/qichangxing> 
http://webpy.org
http://blog.hi0791.com (build with web.py)
http://www.baicai.com °Ù²ÅÕÐƸ
Gtalk: iexper(at)gmail.com 

-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080120/e7443977/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月20日 星期日 21:12

gary.jsz gary.jsz在gmail.com
星期日 一月 20 21:12:11 HKT 2008

ʹÓÃpythonµÄIDLEºÍwindowsµÄcmdÔËÐнá¹û¶¼Ò»ÑùµÄ




·¢¼þÈË£º Handle.Huang
·¢ËÍʱ¼ä£º 2008-01-20 20:51:53
ÊÕ¼þÈË£º python-chinese在lists.python.cn
³­ËÍ£º 
Ö÷Ì⣺ [python-chinese] ´ð¸´: ´ð¸´: ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì

Ö±½ÓÔÚcmdÖÐÔËÐÐÄØ£¿
 
·¢¼þÈË: python-chinese-bounces在lists.python.cn [mailto:python-chinese-bounces在lists.python.cn] ´ú±í gary.jsz
·¢ËÍʱ¼ä: 2008Äê1ÔÂ20ÈÕ 20:47
ÊÕ¼þÈË: python-chinese在lists.python.cn
Ö÷Ìâ: Re: [python-chinese] ´ð¸´: ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì
 
ÎÒÊÇʹÓÃUlipadÖ±½ÓÔËÐеģ¬ÔËÐнá¹û¾ÍÊÇÕâ¸ö¡£
Èç¹ûÎÒʹÓÃutf8µÄ»°£¬ËùÓеÄÊä³ö¶¼ÎÞ·¨ÏÔʾÖÐÎÄ£¬Ê¹ÓÃgb2312»¹Ö»ÊÇÖ±½Ó´òÓ¡µÄ»áÕâÑù¡£
 



·¢¼þÈË£º ´óÀÉ
·¢ËÍʱ¼ä£º 2008-01-20 19:00:04
ÊÕ¼þÈË£º python-chinese在lists.python.cn
³­ËÍ£º 
Ö÷Ì⣺ Re: [python-chinese]´ð¸´: ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì
 
¾ÝÎҵľ­ÑéÊǵ±Ç°ÎļþʹÓÃutf-8±àÂ룬²»»á³öÏÖÎÊÌ⣬²»ÖªÄãÊÇÔÚÃüÁîÐÐÏ»¹ÊÇwebÏ£¿
On 1/20/08, gary.jsz <gary.jsz在gmail.com> wrote: 
ÓÐʲô·½·¨¿ÉÒÔÈÃËûÖ±½Ó´òÓ¡ÖÐÎÄÂ
 



·¢¼þÈË£º Handle.Huang
·¢ËÍʱ¼ä£º 2008-01-20 16:52:10
ÊÕ¼þÈË£º python-chinese在lists.python.cn 
³­ËÍ£º 
Ö÷Ì⣺ [python-chinese] ´ð¸´: ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì
 
PythonÄÚ²¿¶¼ÊÇ°´ÕÕUncodeÀ´´¦ÀíµÄ¡£ 
 
·¢¼þÈË: python-chinese-bounces在lists.python.cn [mailto:python-chinese-bounces在lists.python.cn] ´ú±í gary.jsz
·¢ËÍʱ¼ä: 2008Äê1ÔÂ20ÈÕ 16:36
ÊÕ¼þÈË: python-chinese在lists.python.cn
Ö÷Ìâ: [python-chinese] ¹ØÓÚ´òÓ¡ÂÒÂëÎÊÌ⣬Çë½Ì
 
´úÂëÈçÏ£º
#-*-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 python-chinese在lists.python.cn
Subscribe: send subscribe to python-chinese-request在lists.python.cn
Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
Detail Info: http://python.cn/mailman/listinfo/python-chinese



-- 
http://del.icio.us/iexper
http://twitter.com/qichangxing 
http://webpy.org
http://blog.hi0791.com (build with web.py)
http://www.baicai.com °Ù²ÅÕÐƸ
Gtalk: iexper(at)gmail.com 
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080120/5c2f90b2/attachment-0001.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2024

    京ICP备05028076号