Skip to content

Refresh cells on a timer

Use mo.ui.refresh to run a cell on a timer

Source code for examples/ui/refresh.py

Tip: paste this code into an empty cell, and the marimo editor will create cells for you

import marimo

__generated_with = "0.10.6"
app = marimo.App()


@app.cell
def _():
    import marimo as mo
    return (mo,)


@app.cell
def _(mo):
    refresh = mo.ui.refresh(default_interval=1)
    refresh
    return (refresh,)


@app.cell
def _(refresh):
    print(refresh.value)
    return


if __name__ == "__main__":
    app.run()