File content:
40 13 123
89 123 2223
4 12 0
I need to store the whole .txt
file as a binary array so that I can send it later to the server side which expects a binary input.
I've looked at Python's bytearray documentation.
I quote:
Return a new array of bytes. The bytearray type is a mutable sequence of integers in the range 0 <= x < 256. It has most of the usual methods of mutable sequences, described in Mutable Sequence Types, as well as most methods that the bytes type has, see Bytes and Byte Array Methods.
My numbers are greater than 256, I need a bytearray data structure for numbers that are greater than 256.