En Python 3.7 estoy haciendo:
>>> from struct import pack as spack
>>> a1=spack("LLLL", 45129401,92367215,681285731,1710201)
>>> a1.encode('hex')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'bytes' object has no attribute 'encode'
Pero como veis me da el error:
'bytes' object has no attribute 'encode'