【发布时间】:2020-11-15 07:55:01
【问题描述】:
我在 Python 中以 UTF-8 编码字符串。我需要访问它的二进制文件,但是我不知道如何。下面的代码显示了这一点:
s = 'Hello'.encode('utf-8') #Enconding the UTF-8 string
print(s) #This outputs 'b"Hello"', however I need to access its binary
感谢您的宝贵时间
【问题讨论】:
-
你能解释一下你想用字节做什么吗?
-
您需要更明确地了解“访问”的含义。