I am trying to use str.encode() but I get
str.encode()
>>> \"hello\".encode(hex) Traceback (most recent call last): File \"\", line 1
The hex codec has been chucked in 3.x. Use binascii instead:
hex
>>> binascii.hexlify(b'hello') b'68656c6c6f'