https://docs.python.org/zh-cn/3/library/struct.html
用标准库struct.pack函数。
https://cn.bing.com/search?q=python3+struct&go=%E6%8F%90%E4%BA%A4&qs=n&form=QBLH&sp=-1&pq=python3+struct&sc=1-14&sk=&cvid=C1FFBCB2FC64471DA866912C00DB50EF