Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
file = open("images.jpeg", "rb") c = file.read(512) print(type(c)) print(c) file.close()
c 是一个 str 对象。它不应该是一个字节对象吗?根据医生的说法,应该是!
在 Python 3.2 中,它实际上是一个字节对象。Python2.7 发生了什么?
平台:Kubuntu 12.04 64 位
bytes是strPython 2.7中的别名
bytes
str