jpeg images in python

François Pinard pinard at iro.umontreal.ca
Mon Nov 27 16:55:11 EST 2000


[Gilles Lenfant]

> jf = open('myimage.jpg', 'rb')
> binaryJPGbuffer = jf.read()
> jf.close()

Or even more cleanly (in C Python):

   binaryJPGbuffer = open('myimage.jpg', 'rb').read()

which does the same.  You even spare `jf', and a few nanoseconds :-).

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard




More information about the Python-list mailing list