If you must convert Hex to Byte in Python, then you are able to do one of many following:
Possibility 1 – Utilizing binascii
import binascii
str_val = 'It is a take a look at'.encode('utf-8')
hex_val = binascii.hexlify(str_val).decode('utf-8')
print(hex_val)
Possibility 2 – Utilizing bytes.fromhex()
hex_val = 'It is a take a look at'
print(bytes.fromhex(hex_val))
Possibility 3 – Utilizing unhexlify
import binascii
from binascii import unhexlify
str_val = 'It is a take a look at'.encode('utf-8')
hex_val = binascii.hexlify(str_val).decode('utf-8')
print('String worth: ', str_val.decode('utf-8'))
print('Hexadecimal: ', hex_val)
print('Byte worth: ', unhexlify(hex_val))