Jupyter Notebook

Make sure to install Jupyter using your favorite method. I installed jupyter in my venv and run it from there.

Let’s start off by launching Jupyter!Jupyter notebook launch low res

It’s as easy as that to get started.

 

Here’s the value that jupyter notebook can add to your work flow. 

Retains State –

Jupyter hellow world low res

When running each section shown. It evaluates it independently. Making an error and re-running the section doesn’t require me to re-run the whole script. This is great when you have to evaluate many config files and make a mistake. No reason to re-run the whole script. 

You can even run your connect portion of the script and work on other sections while you wait for the pull to finish.

Export and Share – 

You can chose many formats from python to another jupyter notebook. Share you work easily with others.

It’ll even retain variables, such as when pulling a show run from netmiko.

It Uses iPython – 

That’s cool I guess. I’m not 100% sure on the benefits of iPython. But you do get some magic commands that don’t come with regular python – https://ipython.readthedocs.io/en/stable/interactive/magics.html.

It Easily Works – 

I haven’t run into a situation yet where calling a module hasn’t worked. Even something like getpass.getpass() works.

Debugging – 

No need to print in the middle of the script. Want to see what a variable contains? Just call it. I have found that printing in a loop doesn’t work. Now I may be doing something wrong, but I can get it to work in regular python. 

Undo – 

When hitting ctrl-z, it will only undo what you did in that section!!!

 

 

Did I miss anything? Let me know! I probably haven’t explored jupiter’s full potential yet!

Scroll to Top