1

Is there a default setting in Jupyter Lab to clear output for an entire notebook upon file closure?

Or a bit of code I could run early in the NB with import statements or similar. (I have some NBs where I don't run every cell every time I open).

My current workflow is to manually clear before save and exit, but I just encountered a repo commit where I'd forgotten to do that and I had a bit of an adrenaline spike as I flashed back to a corrupted notebook last year.

My interest is preventing potential problems and minimizing user-executable steps to do so. I'm not interested in stripping from the command line post-hoc.

This thread just clears individual cells.

I'm somewhat intrigued by this one but, without spending more time on it, not clear how much effort it would take to incorporate into my GitKraken flow.

This also seems promising, but again is on the back side of things.

Figured I'd check if I'm missing something much more fundamental.

1 Answer 1

1

I'm using jupytext and convert my notebooks to markdown format, so whenever I close them, the outputs are cleared automatically. https://jupytext.readthedocs.io/en/latest/

Sign up to request clarification or add additional context in comments.

1 Comment

looks promising...cheers!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.