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

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