I'm using ctypes and loading msvcrt.dll in Python 2.5.
>>> from ctypes import *
>>> libname = 'msvcrt.dll'
>>> libc = CDLL(libname)
>>> libc.printf("Hello World\n")
printf() function itself is defined to return the number of characters printed to the output. This is the value that Python receives when you call
ctypes tutorial provides information on why the output from
printf() may not work within your Python REPL (my psychic debugging skills indicate that you're running the Windows GUI IDLE).