Output of the widget to the variable

Is it possible to assign the output of the widget to the variable that is used elsewhere ?

X = btn_run.on_click(execute)
S = np.cov(X, rowvar=False, ddof=1)

You mean, if execute returns something? No, it’s not possible. Just call np.cov in the body of execute.