This is a somewhat strange question. I need to convert an int, such as 123456, to bytes in the format b'123456'. I'm not doing an actual conversion to bytes however, I'm just changing the format to look like a byte and be interpreted as one. So I literally need to do the following:
10 = b'10'
20 = b'20'
30 = b'30'
and so. I can't convert to a string because I need the results to be in bytes, and I can't do an actual byte conversion because bytes([10]) == b'\n' (and not b'10').
Any help is very much appreciated