python struct unpack
msg = self.serverSocket.recv(1024) # 接受服务端消息 AngleSensorST,y_Angle_deg,x_Angle_deg,Z_Angle_deg,AngleDeviceTEMP,WatchdogCount=struct.unpack("!hffffh", msg) print(AngleSensorST,y_Angle_deg,x_Angle_deg,Z_Angle_deg,AngleDeviceTEMP,WatchdogCount)
1 -5.0372314453125 5.537109375 355.2923583984375 30.959999084472656 -16696
############
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/287956.html