- 论坛徽章:
- 0
|
print unichr(0x6709)
s=u'有'
print ord(s)
print hex(ord(s))
luffy.deng 发表于 2010-04-02 17:55 ![]()
好啊,请问用什么语问把 他 这字符 串 变成 中文 的字符串?& #x6770;& #x514b;- >>> s=u'有'
- >>> print ord(s)
- Traceback (most recent call last):
- File "<pyshell#10>", line 1, in <module>
- print ord(s)
- TypeError: ord() expected a character, but string of length 2 found
- >>> print hex(ord(s))
- Traceback (most recent call last):
- File "<pyshell#11>", line 1, in <module>
- print hex(ord(s))
- TypeError: ord() expected a character, but string of length 2 found
- >>>
复制代码 |
|