字符串转换为字节类型

5年以前  |  阅读数:453 次  |  编程语言:Python 
>>> s = "apple"
>>> bytes(s,encoding='utf-8')
b'apple'

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8