06_python

作者: 伶俐ll | 来源:发表于2020-08-13 15:27 被阅读0次

利用python打印字符

zhanglingli@bogon ~ % python

WARNING: Python 2.7 is not recommended. 
This version is included in macOS for compatibility with legacy software. 
Future versions of macOS will not include Python 2.7. 
Instead, it is recommended that you transition to using 'python3' from within Terminal.

Python 2.7.16 (default, Apr 17 2020, 18:29:03) 
[GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc- on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print u'\u767b\u5f55'
登录
>>> unicode('登录','UTF-8')
u'\u767b\u5f55'
>>> exit()
>>> print '\xe7\x99\xbb\xe5\xbd\x95'
登录
>>> unicode('登录','UTF-8').encode('UTF-8')
'\xe7\x99\xbb\xe5\xbd\x95'
>>> unicode('登录','UTF-8')
u'\u767b\u5f55'
>>> 

相关文章

网友评论

      本文标题:06_python

      本文链接:https://www.haomeiwen.com/subject/iammrktx.html