Mey*_*sam 1 python hex python-2.7
我需要将像 4003 这样的无符号整数转换为其十六进制表示。以下代码的输出
print(struct.pack("<I", 4003).encode('hex'))
Run Code Online (Sandbox Code Playgroud)
是
a30f0000
我怎样才能得到以下输出?
00000fa3
没有必要使用struct.pack. 任何其他方法将不胜感激。
| 归档时间: |
|
| 查看次数: |
9360 次 |
| 最近记录: |