As shown below:
def str_to_hex(s): s = (' ') send_buf = b'' for i in range(len(s)): send_buf += ('B',int(s[i],16)) return(send_buf)
Above this on python3.4 string to hexadecimal example details is all I have shared with you, I hope to give you a reference, and I hope you support me more.