Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我从套接字字节数组接收。如何仅将第二个和第三个字节转换为整数(第二个比第三个最不重要)?
也许我错过了你的要求,但你的意思是这样吗?
b = bytearray("123456789") b[1] # 50 b[2] # 51 int(chr(b[1])) # 2 int(chr(b[2])) # 3