MYF

Pursue excellence; Strive for perfection.


  • Home

  • Categories

  • About

  • Archives

  • Tags
MYF

Python3 当字节流出现在字符串中

Posted on 2016-10-24 | In 自学 | | Visitors
1
2
3
4
5
6
>>> a = r'\u559c\u6b22\u4e00\u4e2a\u4eba'
>>> a
'\\u559c\\u6b22\\u4e00\\u4e2a\\u4eba' # a就是你获取的字符串
>>> exec('b="'+a+'"')
>>> b
'喜欢一个人'

参考文章

请教下python3中怎么转Unicode - 饮水思源

# Python
Python3 剪切板的存取
Python3 调用aria2c下载
MenYifan

MenYifan

299 posts
9 categories
96 tags
RSS
GitHub LinkedIn Download ACM
© 2019 MenYifan
Powered by Hexo
Theme - NexT.Pisces