📜  python代码示例中的convert_text_to_hexadecimal_viva.py

📅  最后修改于: 2022-03-11 14:46:06.154000             🧑  作者: Mango

代码示例1
# convert text string to hexa decimal code
str = 'twee'.encode('utf-8')
hex = str.hex()

# convert hexadecimal code to string
str1 = bytes.fromhex(hex).decode('utf-8')

print(hex)
print(str1)