SharedJupyterWidgets / SageInteract.ipynbOpen in CoCalc

1. Simple Sage interact

@interact
def _(
    n = slider(1,10, step_size =1, label="Select a number:")):
    print n

Jupyter Kernel terminated: This might be caused by running out of memory or hitting a bug in some library (e.g., forking too many processes, trying to access invalid memory, etc.). Consider restarting or upgrading your project or running the relevant code directly in a terminal to track down the cause, as explained here.

2. Simple Sage graph interact

@interact
def _(
    m = slider(-2,2, step_size =0.5),
    b = slider(-3,3, step_size =0.5)):
    show(plot(m*x+b,(x,-10,10), ymax = -5, ymin= 5, color ='blue', figsize=(8,5)))

Jupyter Kernel terminated: This might be caused by running out of memory or hitting a bug in some library (e.g., forking too many processes, trying to access invalid memory, etc.). Consider restarting or upgrading your project or running the relevant code directly in a terminal to track down the cause, as explained here.