ztimesbtn = mo.ui.button(value = False, on_click=lambda value: not value, label="Show answer") ztimeslst = [mo.md( r""" Note that $\Bbb Z$ is not a group if we instead take the operation to be multiplication. In this example, we do have a set and operation. The operation is associative. In fact, there is even an identity element! It is """), ztimesbtn]
if ztimesbtn.value: mo.vstack(ztimeslst + [mo.md(r""" 1. """)]) else: mo.vstack(ztimeslst)
mo.md( r""" Just as with propositions: """ ) mo.callout(mo.md(r""" Two sentences, $\alpha$ and $\beta$, are **equivalent** """))
some_endpoint, some_endpoint_button
. Is it possible to implement it in one cell and/or avoid exposing button variable?@app.cell def _(config, private): admin_projects, admin_projects_button = private.request('GET', f'/admin/user/{config.user_id}/projects') admin_projects return admin_projects, admin_projects_button @app.cell def _(admin_projects, admin_projects_button): admin_projects.run(admin_projects_button) return
private.request()
returns (Request, mo.ui.run_button)
tuple:def request(self, method, url, *, json = None): return ( Request( method, f'{self.base_url}{url}', json=json, auth=self.auth, timeout=self.timeout, client=self, ), mo.ui.run_button(label='send'), )
Request.run()
uses mo.stop
and mo.status.spinner
:def run(self, button): mo.stop(not button.value, mo.md('press *send* ☝️')) with mo.status.spinner(subtitle='Loading...') as _spinner: response = self.send() return response
marimo edit
File "/Users/mh/.pyenv/versions/3.10.10/lib/python3.10/site-packages/marimo/_server/utils.py", line 59, in find_free_port return find_free_port(next_port, attempts - 1) File "/Users/mh/.pyenv/versions/3.10.10/lib/python3.10/site-packages/marimo/_server/utils.py", line 59, in find_free_port return find_free_port(next_port, attempts - 1) File "/Users/mh/.pyenv/versions/3.10.10/lib/python3.10/site-packages/marimo/_server/utils.py", line 59, in find_free_port return find_free_port(next_port, attempts - 1) [Previous line repeated 97 more times] File "/Users/mh/.pyenv/versions/3.10.10/lib/python3.10/site-packages/marimo/_server/utils.py", line 43, in find_free_port raise RuntimeError("Could not find a free port") RuntimeError: Could not find a free port
sudo lsof -i -P | grep LISTEN
, but theres none.I'm looking for a way, any way, to highlight text in markdown in marimo, be able to right click or press a button, and add a comment to the highlighted text.
Is this possible in marimo?
@app.cell def input_cell(mo): my_input = mo.ui.text() my_input return (my_input,) @app.cell def result_cell(my_input): my_input.value return
marimo edit
freezes everything up. I've tried most of the low hanging fruit but can't figure out why the output of my marimo env
command leaves "browser" blank. It doesn't do this on the windows side, and I can run marimo fine. Any ideas??mo.ui.radio
for filtering a dataset as part of a larger ML model evaluation UI. I find that when I have a lot options using the inline option just makes a really wide element for the radio component. ncols
, nrows
or columns
for the UI element to define a little radio grid or similar argumentsclass Test(): def __init__(self): self.a = 1 self.b = 2 import inspect inspect.getsource(Test)
mo.hstack([ mo.callout("Main"), mo.vstack([mo.callout("comments") for _ in range(3)], gap = 0.1, align = "stretch", justify = "space-between") ], widths=[0.4, 0.6], align = "stretch")
uv
. If i were to install packages directly from the terminal using uv they would be added to pyproject.toml, it would be great to have packages added to the dependencies in pyproject toml when such file is available and if not running in a sandbox