pc_f=bin(int.from_bytes(b'\x00', byteorder='little', signed=True))
print(pc_f)
'0b0'
我想要得到0b00000000的结果
只能使用字符串处理,先去掉'0b',再右对齐,左边补齐0,然后再加'0b'
或者使用format函数代替bin
pc_f="0b{:08b}".format(int.from_bytes(b'\x00', byteorder='little', signed=True,))
print(pc_f)