最近通道端口通信,但是要求用到高低位传送数据 def low_high(data): high = hex(data >> 8).lstrip('0x') if len(high) < 2: high = '0' + high low = hex(data).lstrip('0x') if len(low) < 2: low = '0' + low else: low = low[-2:] return low.upper() + high.upper() 来源:https://www.cnblogs.com/yubs/p/11677191.html 标签 python high