Comment by xg15

1 day ago

I'd argue "import from notebooks" is still only helpful in the "space bar heating" sense.

I think Notebooks are great for quick, "explorative" sketches of code. They are absolutely terrible for organizing "production" code.

I know it often happens that something starts in a notebook and then sort of morphs into a generic script or full-on application. But I think, this is usually the signal you should refactor, pull out the "grown" parts from the notebooks and organize them into proper Python modules.

If you have parts that are still experimental or explorative, consider importing your new modules into the notebook instead of the other way around.

Source: personal experience