如何从HexBytes对象中获取十六进制字符串?

Duo*_*duo 4 python web3-donotuse

>>> from hexbytes import HexBytes
>>> ...
>>> hb
HexBytes('0x53b983fe73e16f6ed8178f6c0e0b91f23dc9dad4cb30d0831f178')
Run Code Online (Sandbox Code Playgroud)

我有一个HexBytes对象hb,我想得到'0x53b983fe73e16f6ed8178f6c0e0b91f23dc9dad4cb30d0831f178'字符串,我该怎么办?

小智 10

你可以打字hb.hex(),它应该工作