import save string = \"\" with open(\"image.jpg\", \"rb\") as f: byte = f.read(1) while byte != b\"\": byte = f.read(1) print ((byte)) <
import save string = \"\" with open(\"image.jpg\", \"rb\") as f: byte = f.read(1) while byte != b\"\": byte = f.read(1) print ((byte))
You can use bytes.decode function if you really need to "get rid of b": http://docs.python.org/3.3/library/stdtypes.html#bytes.decode
But it seems from your code that you do not really need to do this, you really need to work with bytes.