On 11/6/2018 9:30 PM, jlada...@itu.edu wrote:

b = i.to_bytes(1, "big")

Is there another function which provides a more logical interface to this 
straightforward task?

Yes
>>> 33 .to_bytes(1, 'big')
b'!'
>>> bytes((33,))
b'!'

See >>> bytes(   # in IDLE or >>> help(bytes)


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to