python-escpos/escpos/utils.py

10 lines
176 B
Python
Raw Normal View History

2014-05-31 14:36:00 +00:00
try:
bytes.fromhex
def hex2bytes(hex_string):
return bytes.fromhex(hex_string)
except:
def hex2bytes(hex_string):
return hex_string.decode('hex')