def get_layer_bytes(layer):
 arr = []
 layer = layer.encode('hex')
 for (f, s) in zip(layer[0::2], layer[1::2]):
  arr.append((f + s))
 return arr

def get_layer_bytes ( layer ) : arr = [ ] layer = layer . encode ( 'hex' ) for ( f , s ) in zip ( layer [ 0 : : 2 ] , layer [ 1 : : 2 ] ) : arr . append ( ( f + s ) ) return arr
i havent found a neat way to pull raw bytes out of scapy packets .