def runner():
    kk = 1, 2, 3
n = 3
mm = n + 1
wts = (c_double * n)(1, 1, 1)
res = (c_double * mm)(0)
kks = (c_int * len(kk))(*kk)
n = c_int(n)
ex = c_double(0)
libc.cprogram.restype = None
libc.cprogram(wts, res, kks, n, ex)
print(wts[1])
Доступ к данным по адресу памяти с помощью ctypes