4 ms·
from ctypes import * libc = CDLL("libc.so.6") libc.printf("Hello %s!\n", "world") from sys import stderr libc.fprintf(stderr.fileno(), "Error in
by Hello71 12y ago
from ctypes import *
libc = CDLL("libc.so.6")
libc.printf("Hello %s!\n", "world")
from sys import stderr
libc.fprintf(stderr.fileno(), "Error in line %d\n", nr)
although I don't know why in the world you would want to use printf instead of native string formatting
- eric_bullington 12y agoI presume the printf was just to show Nimrod's easy C interop.