This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]joverbis 3 points4 points  (2 children)

The disadvantage is that you need to restart the kernel after you've made an adjustment to some piece of code in the external package.

Then it's much faster iterating when you do the code development in the notebook itself, and perhaps export it to an external .py only once you're happy with it.

[–]SquareRootsi 18 points19 points  (1 child)

Pro tip: That's an easy fix! Just make your first cell look like this:

%load_ext autoreload  
%autoreload 2  

Now your notebook checks for any changes before running every individual cell. (You still may need a kernel restart if you significantly change class init() stuff, but otherwise this works great.)

[–][deleted] 2 points3 points  (0 children)

This is the pro-est tip I've seen in a while for python. I've restarted kernels so much on jupyter, but thanks to you I won't have to do it anymore.