Pyhon 2.x or 3.x, which is faster?

Steven D'Aprano steve at pearwood.info
Mon Mar 7 20:19:26 EST 2016


On Tue, 8 Mar 2016 07:19 am, BartC wrote:

> I don't have to hand a jpeg file that it can't
> decode.


Run this under Python 2:



from random import randint
blob = [randint(0, 256) for i in range(16*1024)]

with open('broken.jpg', 'wb') as f:
    f.write(''.join(blob))




If your software can decode that, it will be a miracle.


-- 
Steven




More information about the Python-list mailing list