# python2
print(chr(174))
?# python3
print(chr(174))
®
I'm looking for the equivalent of chr() from python2. I believe this is due to python 3 returning unicode characters rather than ASCII.
# python2
print(chr(174))
?# python3
print(chr(174))
®
I'm looking for the equivalent of chr() from python2. I believe this is due to python 3 returning unicode characters rather than ASCII.
Actually, in Py3 chr
is equivalent of unichr
in Py2. You can use bytes
or bytearray
.
For example:
>>> print(bytes([174]))
b'\xae'
or
>>> print(bytearray([174]))
bytearray(b'\xae')
b'\xae' equals to ?