ctypes常用dll

导入ctypes以后cdll.msvcrt为标准c的函数库,可以调用标准C里的函数,如

from ctypes import *
libc = cdll.msvcrt
print(libc.printf)
print(libc.time(None))
print(libc.sin(2))

windll代表windows的一些常用dll,如

from ctypes import *
libc = cdll.msvcrt
print(hex(windll.kernel32.GetModuleHandleA(None)))

 

 

posted @ 2012-12-27 19:50  fff8965  阅读(176)  评论(0编辑  收藏  举报