eugene
eugene
Mmarimo
Created by eugene on 11/8/2024 in #help-support
How to distinguish marimo notebooks from any other python files robustly and efficiently?
If I want to get all marimo notebooks recursively inside a directory, what algorithm can be both robust and efficient?
5 replies
Mmarimo
Created by eugene on 9/30/2024 in #help-support
Terminate a while loop with switch and state
I'm trying to implement an app and a crucial part of it composed of something like below,
get_state, set_state = mo.state(False)

def wait_for_switch() -> bool:
while True:
if get_state():
return True

switch = mo.ui.switch(on_change=set_state)
get_state, set_state = mo.state(False)

def wait_for_switch() -> bool:
while True:
if get_state():
return True

switch = mo.ui.switch(on_change=set_state)
then calling
wait_for_switch()
wait_for_switch()
But when switching, the loop continues Is there a way to terminate this while loop with switch?
3 replies