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.
我有以下十六进制数字 0x00000000004087b8 并且我必须将其转换为 0x4087b8 以便能够将其附加到我的列表中。有谁知道如何在python中进行这种转换?
我假设您有一个字符串,我建议您这样做:
fixed_address = hex(int(address, 16))
也许这样的事情会起作用?
hex_num = "0x00000000004087b8" hex_num = "0x{}".format(hex.split('x')[1].lstrip('0'))