📅  最后修改于: 2022-03-11 14:46:06.154000             🧑  作者: Mango
# 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)