import struct buffer = bytearray(8) buffer[0]=1 buffer[1]=1 struct.pack_into('>ih', buffer, 2, 100, 200) # to convert the array to str print(bytes(buffer))
No comments:
Post a Comment