Source

hack2 / pypyembed / a.py

1
2
3
4
5
6
7
8
9

import traceback
import ctypes, sys

def f(a):
    print 3 + a
    return 3

cfunc = ctypes.cast(ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int)(f), ctypes.c_void_p).value