How to print a file in binary mode

Marc 'BlackJack' Rintsch bj_666 at
Sun Oct 22 15:06:08 CEST 2006

In <1161519385.614985.311240 at>, Lucas wrote:

> I need print a file in binary mode .
> f ='python.jpg','rb')
> bytes =
> f.close()
> print(bytes)
> I can't get any binary code.

What do you mean by "binary code"?  If you use ``print repr(bytes)``
everything outside ASCII will be printed as escape sequence.

But why do you want to "print" JPEG images anyway?

	Marc 'BlackJack' Rintsch

More information about the Python-list mailing list