mylib = CDLL('./mylib.so')
mylib.mySub.argtypes = [POINTER(c_double), c_int, POINTER(c_double)]
mylib.mySub.restype = None
ArrayType = c_double * 5
IntType = c_int
input1 = ArrayType(1.1, 2.2, 3.3, 4.4, 5.5)
input2 = 5
inputoutput = ArrayType()
mylib.mySub(input1, input2, inputoutput)
print('------------------------------------------------------')
print('output within Python')
a = [0, 1, 2, 3, 4]
for ii in a:
    pass
Returning array when calling Fortran from Python using Ctypes