cod*_*ict 14

你可以做:

y = int("0x000000001", 16)
Run Code Online (Sandbox Code Playgroud)

在你的情况下:

y = int(x, 16)
Run Code Online (Sandbox Code Playgroud)

看起来你想将int转换为字符串:

y = str(int(x, 16))
Run Code Online (Sandbox Code Playgroud)