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 ビット
bytesstrはPython 2.7のエイリアスです
bytes
str