Skip to content

Commit 2064ad5

Browse files
edit interactive marimo
1 parent 1308061 commit 2064ad5

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

data_science_tools/marimo_examples/interactive_notebook.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1+
# /// script
2+
# requires-python = ">=3.11"
3+
# dependencies = [
4+
# "marimo",
5+
# ]
6+
# ///
7+
18
import marimo
29

3-
__generated_with = "0.13.0"
10+
__generated_with = "0.13.7"
411
app = marimo.App(width="medium")
512

613

714
@app.cell
815
def _():
16+
import marimo as mo
917
from marimo import ui
1018

11-
multiplier = ui.slider(1, 10, 3, label="Multiplier")
19+
multiplier = ui.slider(1, 10, 1, label="Multiplier")
1220
multiplier
13-
return (multiplier,)
21+
return mo, multiplier
1422

1523

1624
@app.cell
17-
def _(multiplier):
18-
result = [x * multiplier.value for x in range(5)]
19-
print(result)
25+
def _(mo, multiplier):
26+
stars = "⭐" * multiplier.value
27+
mo.md(stars)
2028
return
2129

2230

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ exclude = [
4242
line-length = 88
4343

4444
[tool.ruff.lint]
45-
ignore = ["E501", "F841"]
45+
ignore = ["E501", "F841", "B018"]
4646
select = ["B","C","E","F","W","B9", "I", "Q"]
4747

4848
[tool.ruff.format]

0 commit comments

Comments
 (0)