📜  convert_hex_to_ASCII_3.py - Python 代码示例

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

代码示例1
# Python program using the native method to convert bytes to ASCII string

# take hexadecimal string
hex_str = '0x68 0x65 0x6c 0x6c 0x6f'

# convert hex string to ASCII string
string = ''.join(chr(int(i, 16)) for i in hex_str.split())

# printing ASCII string
print('ASCII String:', string)