I Don’t Really Know What I’m Doing, But I Want to Program in Python! (Part 1)

This article was automatically translated from Japanese using AI. The Japanese version is the authoritative version.

When you start learning programming, I think the first hurdle is figuring out where to begin.
You search online, but then what? And what software are you supposed to use to write the code?

I struggled with exactly that myself.

There are broadly two kinds of tools for writing programs.
One is interactive, and the other is script-based. (I’m putting it this way for clarity; I’m not entirely sure it’s the technically correct terminology…)

With the interactive type, you type one line and get one response back
—you write and run the program line by line, over and over.

The script-based type is more like writing a whole essay and then getting feedback on it—you run the entire program at once.
What most people picture when they think of a program is the script-based type, which looks like a long list of incomprehensible code.

But when you decide to write a script-based program, the problem becomes: which software do you actually use?

On top of that, beginner-level programming lessons often use the interactive style, and then at the intermediate level you’re suddenly writing scripts—yet what to write them in is often left unstated, or differs completely from book to book.

For the interactive style, you use something already built into your computer, like Command Prompt or Terminal, and get started by typing “Python”.

But what do you write script-based programs in?

Most script-based programs are written in an IDE (integrated development environment). (When you’re stuck, searching for “Python IDE recommendations” turns up plenty of articles.)

The ones I normally use for writing script-based programs are
Jupyter Notebook and PyCharm.
(Apparently some people pronounce “Jupyter” as “joo-pih-ter” and others as “joo-py-ter”.)

I use Jupyter Notebook for statistical analysis and plotting graphs, and PyCharm for controlling hardware and for more complex programs.

Let me explain what each one is like.

First, Jupyter Notebook.
It comes bundled when you download Anaconda.
When you launch Jupyter Notebook, a browser such as Safari or Firefox opens first.

Then a listing of the files on your computer appears.
Open the folder you want, and click “New” in the upper right.
Then click Python3, and a screen like the image below opens.
Saving this file gives you a *.ipynb file.

You write code into individual cells, and by clicking the RUN button at the top you can execute the program one cell at a time.

Being able to run code cell by cell is a huge advantage when working with graphs and statistics.
That’s why I use it so often.

I use PyCharm for opening *.py files.
Note that the two tools open different types of files.

For PyCharm, please refer to other sites.
(I haven’t used it much yet, so I’d like to cover how to use it in detail in a future post.)

The Anaconda site is here

The Jupyter Notebook site is here

The PyCharm site is here
For the download, choose the gray Community edition rather than Professional—that’s the free one.
I’d recommend downloading that one to start with.

Since I’ve been using Jupyter Notebook a lot lately, I plan to keep posting updates as notes on my own learning and for anyone who wants to learn programming.

Previous
Next