def intToBytes(integer, length=None):
 hexString = ('%x' % (integer,))
 if (length is None):
  n = len(hexString)
 else:
  n = (length * 2)
 return binascii.unhexlify(hexString.zfill((n + (n & 1))))

def intToBytes ( integer , length = None ) : hexString = ( '%x' % ( integer , ) ) if ( length is None ) : n = len ( hexString ) else : n = ( length * 2 ) return binascii . unhexlify ( hexString . zfill ( ( n + ( n & 1 ) ) ) )
convert a python l{int} to packed data .