Just wanted to mention that you're always able to do this:
for _x in range(100):
...
This way, `_x` is detected as a throwaway Python variable. And it won't re-appear in other cells.
Also, within the same cell you can always re-assign. But you can't do that in another cell. We want to ensure that a variable is fully declared in one, and only one, cell.
Noticed a similar thing with calmcode.io, the numbers don't lie. At the same time though, the setup of that site is so light/cheap that it remains zero effort to just keep the tutorials up.
In hindsight, I am _very_ happy that I never made that project into a main source of income.
Multiple people have offered but decided against it for a few reasons.
- Proper reviews actually feel like they would take me as much time as doing it myself.
- One benefit of doing it all myself is that all the content has a familiar style.
- The downside of contributions is that a lot of the stuff that I see on YT just simply doesn't fit the style that I intend to have on calmcode. So before accepting contributions it also feels like I would have to vet the person who makes the contrib.
A lot of the aforementioned is more complex now as well due to the fact that folks can pay for the platform. It was a 100% free platform before, and right now it's a 99% free platform and some people pay a stipend to keep the site running. If contributions come in, I would also need to figure out a way to keep the incentives aligned, which also complicates things.
I've had a collaborator in the past and a bunch of things worked out there. But he's gone off to do other things, all of which is fair enough.
It certainly has some of the “widget feelings” from streamlit but the real killer feature is that you’re still always in a notebook. You can still explore with these widgets, which is a stellar experience.
marimo is open source and uses a reactive model which makes it fun to mix/match widgets with Python code. It even supports gamepads if you wanted to go nuts!
I have had a similar situation and my "hack" for this was to start the same notebook twice and have two tabs open. This worked for something things ...
Other times I just bit the bullet and made two forms on two variables so that everything would fit in a single notebook. By having two variables that contain all the inputs you can make sure that only the cells update that need to update. It takes a bit more effort but makes a lot of sense for some apps that you want to share with a colleague.
If you share more details about your setup I might be able to give better advice/think along more.
The `export` command can generate a rendered artifact if that's what you're after but there is also another avenue here, have you seen the caching feature? The one that caches to disk and persists?
This can automatically store the output of expensive functions, keeping the previous state of the cells in mind. If a re-compute ever needs to happen it will just load it straight from cache.
Another option is to run in lazy mode, documented here:
This will prevent the notebook from rerunning cells by accident.
We're thinking about adding features that would make marimo great for running long running batch work but there's not a whole lot I can share about it yet. If you have specific thoughts or concerns though, feel free to join our discord!
People also know me from the calmcode youtube channel and https://calmcode.io website