2004年09月21日 星期二 14:09
我用python从ldap中读取信息,得到其中的内容,下面是一些片段: 'ou': ['\xe7\xbe\x8e\xe5\xb7\xa5'] 可是这部分原来是中文,怎么正常显示出来呢? _________________________________________________________ Do You Yahoo!? 150万曲MP3疯狂搜,带您闯入音乐殿堂 http://music.yisou.com/ 美女明星应有尽有,搜遍美图、艳图和酷图 http://image.yisou.com 1G就是1000兆,雅虎电邮自助扩容! http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/
2004年09月21日 星期二 14:15
试了一下: Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> ou = ['\xe7\xbe\x8e\xe5\xb7\xa5'] >>> s = ou[0] >>> s '\xe7\xbe\x8e\xe5\xb7\xa5' >>> type(s)>>> ou0 = unicode(s, 'utf-8') >>> print ou0 美工 On Tue, 21 Sep 2004 14:09:43 +0800 (CST), mike gaul <zopemaillistcn at yahoo.com.cn> wrote: > 我用python从ldap中读取信息,得到其中的内容,下面是一些片段: > > 'ou': ['\xe7\xbe\x8e\xe5\xb7\xa5'] > > 可是这部分原来是中文,怎么正常显示出来呢? > > _________________________________________________________ > Do You Yahoo!? > 150万曲MP3疯狂搜,带您闯入音乐殿堂 > http://music.yisou.com/ > 美女明星应有尽有,搜遍美图、艳图和酷图 > http://image.yisou.com > 1G就是1000兆,雅虎电邮自助扩容! > http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/ > _______________________________________________ > python-chinese list > python-chinese at lists.python.cn > http://python.cn/mailman/listinfo/python-chinese > -- 欢迎访问:http://blog.csdn.net/ccat 刘鑫 March.Liu
2004年09月21日 星期二 14:20
要用python打印出来。而且要直接输出值才可以。如果你的例子是这样的字典:
a={'ou':['\xe7\xbe\x8e\xe5\xb7\xa5']}
可以
for s in a['ou']:
print s
On Tue, 21 Sep 2004 14:09:43 +0800 (CST), mike gaul
<zopemaillistcn at yahoo.com.cn> wrote:
> 我用python从ldap中读取信息,得到其中的内容,下面是一些片段:
>
> 'ou': ['\xe7\xbe\x8e\xe5\xb7\xa5']
>
> 可是这部分原来是中文,怎么正常显示出来呢?
>
> _________________________________________________________
> Do You Yahoo!?
> 150万曲MP3疯狂搜,带您闯入音乐殿堂
> http://music.yisou.com/
> 美女明星应有尽有,搜遍美图、艳图和酷图
> http://image.yisou.com
> 1G就是1000兆,雅虎电邮自助扩容!
> http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/
> _______________________________________________
> python-chinese list
> python-chinese at lists.python.cn
> http://python.cn/mailman/listinfo/python-chinese
>
--
I like python!
2004年09月21日 星期二 14:36
那比如要从某地读取出来,然后写入,那写入的应该是那个? '\xe7\xbe\x8e\xe5\xb7\xa5'? 还是'美工'? --- March Liu <March.Liu at gmail.com> 的正文: > 试了一下: > > Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC > v.1200 32 bit (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for > more information. > >>> ou = ['\xe7\xbe\x8e\xe5\xb7\xa5'] > >>> s = ou[0] > >>> s > '\xe7\xbe\x8e\xe5\xb7\xa5' > >>> type(s) >> >>> ou0 = unicode(s, 'utf-8') > >>> print ou0 > 美工 > > On Tue, 21 Sep 2004 14:09:43 +0800 (CST), mike gaul > <zopemaillistcn at yahoo.com.cn> wrote: > > > 我用python从ldap中读取信息,得到其中的内容,下面是一些片段: > > > > 'ou': ['\xe7\xbe\x8e\xe5\xb7\xa5'] > > > > 可是这部分原来是中文,怎么正常显示出来呢? > > > > > _________________________________________________________ > > Do You Yahoo!? > > 150万曲MP3疯狂搜,带您闯入音乐殿堂 > > http://music.yisou.com/ > > 美女明星应有尽有,搜遍美图、艳图和酷图 > > http://image.yisou.com > > 1G就是1000兆,雅虎电邮自助扩容! > > > http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/ > > _______________________________________________ > > python-chinese list > > python-chinese at lists.python.cn > > http://python.cn/mailman/listinfo/python-chinese > > > > > > -- > 欢迎访问:http://blog.csdn.net/ccat > > 刘鑫 > March.Liu > _______________________________________________ > python-chinese list > python-chinese at lists.python.cn > http://python.cn/mailman/listinfo/python-chinese > _________________________________________________________ Do You Yahoo!? 150万曲MP3疯狂搜,带您闯入音乐殿堂 http://music.yisou.com/ 美女明星应有尽有,搜遍美图、艳图和酷图 http://image.yisou.com 1G就是1000兆,雅虎电邮自助扩容! http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/
2004年09月21日 星期二 14:43
保存的时候,一般用该unicode字符串的编码字符串,即ustr.encode('utf-8')
On Tue, 21 Sep 2004 14:20:57 +0800, limodou <limodou at gmail.com> wrote:
> 要用python打印出来。而且要直接输出值才可以。如果你的例子是这样的字典:
> a={'ou':['\xe7\xbe\x8e\xe5\xb7\xa5']}
> 可以
> for s in a['ou']:
> print s
>
>
> On Tue, 21 Sep 2004 14:09:43 +0800 (CST), mike gaul
> <zopemaillistcn at yahoo.com.cn> wrote:
> > 我用python从ldap中读取信息,得到其中的内容,下面是一些片段:
> >
> > 'ou': ['\xe7\xbe\x8e\xe5\xb7\xa5']
> >
> > 可是这部分原来是中文,怎么正常显示出来呢?
> >
> > _________________________________________________________
> > Do You Yahoo!?
> > 150万曲MP3疯狂搜,带您闯入音乐殿堂
> > http://music.yisou.com/
> > 美女明星应有尽有,搜遍美图、艳图和酷图
> > http://image.yisou.com
> > 1G就是1000兆,雅虎电邮自助扩容!
> > http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/
> > _______________________________________________
> > python-chinese list
> > python-chinese at lists.python.cn
> > http://python.cn/mailman/listinfo/python-chinese
> >
>
> --
> I like python!
>
>
> _______________________________________________
> python-chinese list
> python-chinese at lists.python.cn
> http://python.cn/mailman/listinfo/python-chinese
>
--
欢迎访问:http://blog.csdn.net/ccat
刘鑫
March.Liu
2004年09月21日 星期二 14:45
写入的是这个'\xe7\xbe\x8e\xe5\xb7\xa5',美工只是你看到的样子,每个汉字都有一个内部的编码,象中国有GB,GBK几种标准编码。这里你使用的是utf-8编码,如果改成常用的GBK编码可能就是:'\xc3\xc0\xb9\xa4'了,但打印出来仍然是美工两个字。如果是unicode,则是:u'\u7f8e\u5de5' On Tue, 21 Sep 2004 14:36:07 +0800 (CST), mike gaul <zopemaillistcn at yahoo.com.cn> wrote: > 那比如要从某地读取出来,然后写入,那写入的应该是那个? > '\xe7\xbe\x8e\xe5\xb7\xa5'? > 还是'美工'? > > --- March Liu <March.Liu at gmail.com> 的正文: > > 试了一下: > > > > Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC > > v.1200 32 bit (Intel)] on win32 > > Type "help", "copyright", "credits" or "license" for > > more information. > > >>> ou = ['\xe7\xbe\x8e\xe5\xb7\xa5'] > > >>> s = ou[0] > > >>> s > > '\xe7\xbe\x8e\xe5\xb7\xa5' > > >>> type(s) > >> > >>> ou0 = unicode(s, 'utf-8') > > >>> print ou0 > > 美工 > > > > On Tue, 21 Sep 2004 14:09:43 +0800 (CST), mike gaul > > <zopemaillistcn at yahoo.com.cn> wrote: > > > > > > 我用python从ldap中读取信息,得到其中的内容,下面是一些片段: > > > > > > 'ou': ['\xe7\xbe\x8e\xe5\xb7\xa5'] > > > > > > 可是这部分原来是中文,怎么正常显示出来呢? > > > > > > > > > _________________________________________________________ > > > Do You Yahoo!? > > > 150万曲MP3疯狂搜,带您闯入音乐殿堂 > > > http://music.yisou.com/ > > > 美女明星应有尽有,搜遍美图、艳图和酷图 > > > http://image.yisou.com > > > 1G就是1000兆,雅虎电邮自助扩容! > > > > > > http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/ > > > _______________________________________________ > > > python-chinese list > > > python-chinese at lists.python.cn > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > -- > > 欢迎访问:http://blog.csdn.net/ccat > > > > 刘鑫 > > March.Liu > > _______________________________________________ > > python-chinese list > > python-chinese at lists.python.cn > > http://python.cn/mailman/listinfo/python-chinese > > > > _________________________________________________________ > Do You Yahoo!? > 150万曲MP3疯狂搜,带您闯入音乐殿堂 > http://music.yisou.com/ > 美女明星应有尽有,搜遍美图、艳图和酷图 > http://image.yisou.com > 1G就是1000兆,雅虎电邮自助扩容! > http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/ > _______________________________________________ > python-chinese list > python-chinese at lists.python.cn > http://python.cn/mailman/listinfo/python-chinese > -- I like python!
2004年09月21日 星期二 14:47
那是不是就是说,如果我不需要显示,而仅仅把这边 的数据导到那边,就可以不用转换来转换去了?直接 把这边的数据直接导入到那边就可以了? --- March Liu <March.Liu at gmail.com> 的正文: > 保存的时候,一般用该unicode字符串的编码字符串,即ustr.encode('utf-8') > > > On Tue, 21 Sep 2004 14:20:57 +0800, limodou > <limodou at gmail.com> wrote: > > > 要用python打印出来。而且要直接输出值才可以。如果你的例子是这样的字典: > > a={'ou':['\xe7\xbe\x8e\xe5\xb7\xa5']} > > 可以 > > for s in a['ou']: > > print s > > > > > > On Tue, 21 Sep 2004 14:09:43 +0800 (CST), mike > gaul > > <zopemaillistcn at yahoo.com.cn> wrote: > > > > 我用python从ldap中读取信息,得到其中的内容,下面是一些片段: > > > > > > 'ou': ['\xe7\xbe\x8e\xe5\xb7\xa5'] > > > > > > 可是这部分原来是中文,怎么正常显示出来呢? > > > > > > > _________________________________________________________ > > > Do You Yahoo!? > > > 150万曲MP3疯狂搜,带您闯入音乐殿堂 > > > http://music.yisou.com/ > > > 美女明星应有尽有,搜遍美图、艳图和酷图 > > > http://image.yisou.com > > > 1G就是1000兆,雅虎电邮自助扩容! > > > > http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/ > > > _______________________________________________ > > > python-chinese list > > > python-chinese at lists.python.cn > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > -- > > I like python! > > > > > > _______________________________________________ > > python-chinese list > > python-chinese at lists.python.cn > > http://python.cn/mailman/listinfo/python-chinese > > > > > > -- > 欢迎访问:http://blog.csdn.net/ccat > > 刘鑫 > March.Liu > _______________________________________________ > python-chinese list > python-chinese at lists.python.cn > http://python.cn/mailman/listinfo/python-chinese > _________________________________________________________ Do You Yahoo!? 150万曲MP3疯狂搜,带您闯入音乐殿堂 http://music.yisou.com/ 美女明星应有尽有,搜遍美图、艳图和酷图 http://image.yisou.com 1G就是1000兆,雅虎电邮自助扩容! http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/
2004年09月21日 星期二 14:51
嗯,明白了,是不是就是说,本质上,都是一样的。 --- limodou <limodou at gmail.com> 的正文: > 写入的是这个'\xe7\xbe\x8e\xe5\xb7\xa5',美工只是你看到的样子,每个汉字都有一个内部的编码,象中国有GB,GBK几种标准编码。这里你使用的是utf-8编码,如果改成常用的GBK编码可能就是:'\xc3\xc0\xb9\xa4'了,但打印出来仍然是美工两个字。如果是unicode,则是:u'\u7f8e\u5de5' > > > On Tue, 21 Sep 2004 14:36:07 +0800 (CST), mike gaul > <zopemaillistcn at yahoo.com.cn> wrote: > > > 那比如要从某地读取出来,然后写入,那写入的应该是那个? > > '\xe7\xbe\x8e\xe5\xb7\xa5'? > > 还是'美工'? > > > > --- March Liu <March.Liu at gmail.com> 的正文: > > > 试了一下: > > > > > > Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC > > > v.1200 32 bit (Intel)] on win32 > > > Type "help", "copyright", "credits" or "license" > for > > > more information. > > > >>> ou = ['\xe7\xbe\x8e\xe5\xb7\xa5'] > > > >>> s = ou[0] > > > >>> s > > > '\xe7\xbe\x8e\xe5\xb7\xa5' > > > >>> type(s) > > >> > > >>> ou0 = unicode(s, 'utf-8') > > > >>> print ou0 > > > 美工 > > > > > > On Tue, 21 Sep 2004 14:09:43 +0800 (CST), mike > gaul > > > <zopemaillistcn at yahoo.com.cn> wrote: > > > > > > > > > > 我用python从ldap中读取信息,得到其中的内容,下面是一些片段: > > > > > > > > 'ou': ['\xe7\xbe\x8e\xe5\xb7\xa5'] > > > > > > > > 可是这部分原来是中文,怎么正常显示出来呢? > > > > > > > > > > > > > > _________________________________________________________ > > > > Do You Yahoo!? > > > > 150万曲MP3疯狂搜,带您闯入音乐殿堂 > > > > http://music.yisou.com/ > > > > 美女明星应有尽有,搜遍美图、艳图和酷图 > > > > http://image.yisou.com > > > > 1G就是1000兆,雅虎电邮自助扩容! > > > > > > > > > > http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/ > > > > > _______________________________________________ > > > > python-chinese list > > > > python-chinese at lists.python.cn > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > -- > > > 欢迎访问:http://blog.csdn.net/ccat > > > > > > 刘鑫 > > > March.Liu > > > _______________________________________________ > > > python-chinese list > > > python-chinese at lists.python.cn > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > _________________________________________________________ > > Do You Yahoo!? > > 150万曲MP3疯狂搜,带您闯入音乐殿堂 > > http://music.yisou.com/ > > 美女明星应有尽有,搜遍美图、艳图和酷图 > > http://image.yisou.com > > 1G就是1000兆,雅虎电邮自助扩容! > > > http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/ > > _______________________________________________ > > python-chinese list > > python-chinese at lists.python.cn > > http://python.cn/mailman/listinfo/python-chinese > > > > > > -- > I like python! > _______________________________________________ > python-chinese list > python-chinese at lists.python.cn > http://python.cn/mailman/listinfo/python-chinese > _________________________________________________________ Do You Yahoo!? 150万曲MP3疯狂搜,带您闯入音乐殿堂 http://music.yisou.com/ 美女明星应有尽有,搜遍美图、艳图和酷图 http://image.yisou.com 1G就是1000兆,雅虎电邮自助扩容! http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/
2004年09月21日 星期二 16:11
limodou,您好!
使用中又发现两个小问题:
1,启用代码折叠后,如果在有些代码折叠起来后存盘时,编辑区显示发生改变。
我初用时吓了一跳,以为代码丢了,后来发现只是显示出了问题。
2,进入片断代码管理,如果没有先选择片断分类,其它填写完成后,点增加按扭:
Traceback (most recent call last):
File "D:\DevelopTools\NewEdit\src\mixins\SnippetWindow.py", line 497, in OnAdd
if self.codes.has_key(abbr):
AttributeError: 'SnippetsCodeDialog' object has no attribute 'codes'
这时,如果再去选择片断分类,你会发现编辑被清空了.
如果没有创建分类的话也会这样,建议应加个提示或创建个默认分类。
另外,建议增加调试功能,我现在都是先用newEdit编辑,再用IDLE打开进行调试.
======= 2004-09-21 13:25:39 您在来信中写道:=======
>感谢0.706的指出我已经更新的 NewEdit,可以去http://wiki.woodpecker.org.cn/moin.cgi/NewEdit
>下载 NewEdit 2.7r2版
>
>--
>I like python!
>_______________________________________________
>python-chinese list
>python-chinese at lists.python.cn
>http://python.cn/mailman/listinfo/python-chinese
= = = = = = = = = = = = = = = = = = = =
致
礼!
0.706
0.706 at 163.com
2004-09-21
Zeuux © 2025
京ICP备05028076号