Hi,
I am facing trouble with updating widget value. Any help is highly appreciated.

Here is relevant details:
I have two widgets (one dropdown and another html text). My uses will change 
the value from dropdown and will expect to see the effect in html text. 
Additional note 1 : my current development uses interact() function. It will be 
great help if you enable me to persist the current structure. 
Additional note 2 : I need to make sure that the development is fit for both 
python 2 and 3.

Here is the relevant architecture:

from __future__ import print_function
from ipywidgets import interact, interactive, fixed, interact_manual
import ipywidgets as widgets

def coreCalculationFunction(wantToUpdateIt,myOptions):
    
    if myOptions is 'a':
        wantToUpdateIt='first alphabet in english'
    elif myOptions is 'b':
        wantToUpdateIt='second alphabet in english'
    else:
        wantToUpdateIt='anything else here!'
    
    return myOptions

def optionsRelatedFunction():
    myOptions=['a', 'b', 'c']
    wantToUpdateIt=widgets.HTML(value="Hello World")
    res=interact(coreCalculationFunction,
                 wantToUpdateIt=wantToUpdateIt,
                 myOptions=myOptions);
    return res


optionsRelatedFunction()


Thank you very much for your kind help.

Best regards,
Malitha Humayun Kabir

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/c36112ea-bcdf-4fa1-963e-6efd601fb2f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to