Ask Your Question

Revision history [back]

Mixing GP and @interact in one cell

What's wrong with my code? It doesn't work inside Sage Cell.

gp("""
square(x)=x^2;
""")

@interact
def _(x=2):
    print(square(x))

When I press evaluate button code runs forever with no output at all. I can't figure out what is the problem.