Re: Question about binary file reading

2009-03-05 Thread vibgyorbits
On Mar 5, 9:24 am, Marco Mariani wrote: > 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 wa

Re: Question about binary file reading

2009-03-05 Thread vibgyorbits
k,thanks all. l=map(lambda x: '%02x' %ord(x),d) s=string.join(l,sep='') PS#. Endedup learning little bit of Lambda functions. :-) Scott David Daniels <<< Thanks for your wisdom about the "spaces". Its a 3 liner code-snippet! -- http://mail.python.org/mailman/listinfo/python-list

Question about binary file reading

2009-03-04 Thread vibgyorbits
I'm writing a tool to do some binary file comparisons. I'm opening the file using fd=open(filename,'rb') # Need to seek to 0x80 (hex 80th) location fd.seek(0x80) # Need to read just 8 bytes and get the result back in hex format. x=fd.read(8) print x This prints out garbage. I would like to kno