Question about binary file reading

Marco Mariani marco at sferacarta.com
Thu Mar 5 10:24:47 EST 2009


vibgyorbits wrote:

> l=map(lambda x: '%02x' %ord(x),d)
> s=string.join(l,sep='')
> 
> PS#. Endedup learning little bit of Lambda functions. :-)

That's so 2007...

The 2.5-esque way to write that is

s = ''.join('%02x' % ord(x) for x in d)




More information about the Python-list mailing list