|
Size: 1525
Comment:
|
← Revision 4 as of 2009-12-25 07:15:52 ⇥
Size: 1458
Comment: converted to 1.6 markup
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 5: | Line 5: |
| [[TableOfContents]] | <<TableOfContents>> |
| Line 7: | Line 7: |
| [[Include(ZPyUGnav)]] | <<Include(ZPyUGnav)>> |
| Line 62: | Line 62: |
| 创建 by -- ZoomQuiet [[[DateTime(2009-03-13T16:39:40Z)]]] ||<^>[[PageComment2]]||<^>[:/PageCommentData:PageCommentData]''|| |
创建 by -- ZoomQuiet [<<DateTime(2009-03-13T16:39:40Z)>>] |
找出所有中文
php 的
TualatriX <[email protected]> reply-to [email protected] to python-cn`CPyUG`华蟒用户组 <[email protected]> date Fri, Mar 13, 2009 at 22:13 subject [CPyUG:81295] 如何用Python来输出所有汉字?
看到一段PHP代码,很酷!把所有汉字都打印出来了,代码如下:
http://www.phpweblog.net/fuyongjie/archive/2009/03/13/6384.html
<? php
$begin = hexdec ( " 4e00 " ); // 16进制转化为10进制
$end = hexdec ( " 9fa5 " );
$a = ' [" ' ;
for ( $i = $begin ; $i <= $end ; $i ++ ) {
$a .= ' \u ' . dechex ( $i );
if ( $i % 10 == 0 ) {
$a .= " <br> " ;
}
}
$a .= ' "] ' ;
print_r (json_decode( $a ));
?>不知道用Python要该如何实现?想来想去想不出来,所以请教大家。
py 的
刘其帅 <[email protected]> reply-to [email protected] to [email protected] date Fri, Mar 13, 2009 at 22:20
>>> for ch in xrange(0x4e00, 0x9fa6): ... print unichr(ch)
反馈
创建 by -- ZoomQuiet [2009-03-13 16:39:40]
