CoCalc -- Collaborative Calculation in the Cloud
Sharedsupport / 2016-05-29-interact.sagewsOpen in CoCalc

Examples for support purposes...

Given the relationship between V and P is V=P+107, and two input_box are defined.

@interact
def _(P=input_box(20, width=6, label="power(dBm)"),V=input_box(127, width=6, label="voltage(dBuV)")):
    V=P+107

want to know is it possible to realize when I input the new number to the input_box of P, the input_box of V will dynamically update the value base on the relationship of V=P+107. and the vice versa.

@interact
def f(P=input_box(20, width=15, label="power(dBm)"),V=input_box(127, width=15, label="voltage(dBuV)")):
    print "before update, V = ", V
    f.V = P+107
Interact: please open in CoCalc