#NEWLINE# def hexdump( data ) : #NEWLINE# #INDENT# 'yield lines with hexdump of data' #NEWLINE# values = [ ] #NEWLINE# ascii = [ ] #NEWLINE# offset = 0 #NEWLINE# for ( h , a ) in sixteen ( data ) : #NEWLINE# #INDENT# if ( h is None ) : #NEWLINE# #INDENT# ( yield ( offset , ' ' . join ( [ '' . join ( values ) , '' . join ( ascii ) ] ) ) ) #NEWLINE# del values [ : ] #NEWLINE# del ascii [ : ] #NEWLINE# offset += 16 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# values . append ( h ) #NEWLINE# ascii . append ( a )