如何在python的print中格式化打印longlong型(即64位)整数

from ctypes import c_longlong as longlong

myll = longlong(1234567890123456)
print "%d" % myll

报错:
    print "%d" % myll
TypeError: %d format: a number is required, not c_longlong

请问如何打印c_longlong型呢?或者如何把64位整数格式化到字符串中呢?我的sql查询中用到了

1、

myll = longlong(1234567890123456)
msvcrt = cdll.msvcrt
msvcrt.printf("%I64u/n", myll)

2、

print "%Ld" % myll.value

猜你喜欢

转载自blog.csdn.net/andoring/article/details/6564106