Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

366 B
Raw Blame

Lazy

/// marimo-embed

@app.cell
def __():
    mo.accordion({
        "Open me": mo.lazy(expensive_number, show_loading_indicator=True)
    })
    return

@app.cell
def __():
    import time
    import random

    def expensive_number():
        time.sleep(1)
        num = random.randint(0, 100)
        return num
    return

///

::: marimo.lazy