Skip to main content

Command Palette

Search for a command to run...

Why Does No Python-Tutorial Mention Jupyter? What?

Jupyter Notebooks or Jupyter-like code-cells make life so much easier

Published
3 min read
Why Does No Python-Tutorial Mention Jupyter? What?
T

Worked in the past as SoMe-Manager for big Companies and Non-Profit. Several years of experience in Tech-Journalism. Now content creation by day and programming by night.

I have been trying a lot of free Python tutorials before sticking to one paid version. But it needed a person who worked in tech to tell me that Jupyter Notebooks exist and that they can make the life of someone who is new to Python, so much easier. This should be part of every tutorial!

Since I am not an expert, let me very amateurish explain that concept to you. I do not in any way guarantee it being complete! With Jupyter you can basically create a documentation file with executable python code in it. Your file is split up in different cells and those cells can contain basically everything you need for explaining, visualizing, and running your code. It's far beyond #-comments in your code. You can write articles with executable code in them. But you can also do another thing. You can experiment with how your code works. You can even choose to not run certain parts of your code to try different ways without having to comment out code parts. It's an amazing way to experiment, learn, analyze and mentally organize your code.

How Do I Try This?

# %%
msg = "Hello World"
print(msg)

# %%
msg = "Hello again"
print(msg)

Writing # %% into VSCode will create the beginning of a cell above your code. It will look something like this in your Editor.

jupyter.jpg

You can now treat each cell independently if you chose to. You can also still run the whole code normally. Running cells will open an interactive IPython window in VSCode. In that you see the results of your code, you can also type in code to further test and try. For a fact, most of the experiments in the Cat-Algorithm Project were done with Jupyter-Elements in the Python-File.

catjupyter.jpg

Tutorials Should Talk About This

Testing, understanding, experimenting with code is so much more convenient like this. Tutorials should talk about it. Sure maybe not in the first lesson but once they are through the rough basics, a small "Oh by the way this is a neat way to test and document your code" would be pretty amazing. This might be old news for people following the development of Python over the years, but for beginners - this is not mentioned anywhere unless someone points it out to you.

The only down sight to this, that I found was that PyCharm does not support # %% natively but requires you to use the paid version. But in that case, you could also hop over to Google Colab and use their browser version or use VSCode.

For anyone else learning Python - try it out. You'd be surprised how much it helps your understanding of your code.

S

Thanks for the heads up! I'm an economics student learning Python, love it when I see dimes online which makes the learning process easier.

P

Hi, the hell tutorials you take? about 50% tuts i saw presented Jupyter Notebooks or IPython. Not at the begining but somwhere around functions

T
Tiia4y ago

Free and paid ones. Non mentions them.

D
Datagod4y ago

UNBELIEVABLE!

I saw mention of Jupyter Notebooks, had no idea what they were so I moved on .

I just typed my first # %% and clicked 'debug'. Visual Studio Code started and configuring itself. This is going to be sooooo good. Thank you!!

T
Tiia4y ago

You are very welcome! Knowing about this has made me so much more confident doing changes and trying things out.

1
M
MCCurcio4y ago

Absolutely, Love the IPython Notebook. I wish there were more nb extensions.

T
Tiia4y ago

Totally agree!

1
N
Noah Ford4y ago

Totally agree that Jupyter is an awesome tool! Unfortunately I started my journey in notebooks so learning to utilize an IDE well had it's own challenges 😅!

T
Tiia4y ago

I can imagine. I think both possibilities should be taught early on, at least these days. It would have made my first steps so much easier :D

Learning Python

Part 2 of 5

I will write here about my progression in learning Python as a complete Beginner.

Up next

It's Only Two Days Left For The Humble Bundle Machine Learning Books!

Much smarts for little money!