约 385 字
约 2 分钟
说明:类型转换为 bytearray。
def bytearray(x):
'''
类型转换为 bytearray
:param x: 一个变量
:return: x 转换为 bytearray 后的值
'''
示例:
print(bytearray(b'hello'))
print(bytearray('hello'.encode()))
print(bytearray('hello', encoding='utf-8'))
Loading...
创建于 2025/5/9 23:27:43
更新于 2025/5/11 16:48:17