Hello World Example
Note, that interactivity does not work in the static HTML docs.
You can download the source of this page as a Jupyter notebook using the “View page source” or “Edit on GitHub” link in the upper right corner.
[1]:
from autocalc.autocalc import Var
import ipywidgets as widgets
[2]:
name_input=Var('Your name', description='Enter your name', widget=widgets.Text())
def greeting_text(name):
return f'Hello {name}'
greeting = Var('Greeting', fun=greeting_text, inputs=[name_input], widget=widgets.Text(), read_only=True)
[3]:
display(name_input)
display(greeting)
[4]:
display(greeting.widget)