def func(x, y):
    return cos(x) + cos(y)

def func2(y, a, b):
    return integrate.quad(func, a, b, args=(y,))[0]
print(integrate.quad(func2, -pi / 2, pi / 2, args=(-pi / 2, pi / 2))[0])
2D integrals in SciPy