Learn to program with Python

NOTE: this is a work-in-progress

This article aims to help those, who want to learn how to program, to get started without being distracted by large number of options available. I believe that Python is the best choice currently for learning to program, because Python is both easy and useful.

Installing

For learning Python I recommend Thonny, which is an open-source Python code editor orientated towards beginners that incorporates Python itself, so you only need to install Thonny to get started. I recommend using Thonny instead of the built-in IDLE code editor, which is obsolescent, “disposable” and unsuitable for beginners, in my opinion.

Learning

There are many Python learning resources available on the web. Too many in fact, with so many options there is great potential for confusing and wasting time, if you don’t know where to start.

I recommend starting with Think Python 2nd ed. by Allen B. Downey, which is free-to-read online, or you can buy the book if you prefer.

The next learning resource I recommend is the book Automate the Boring Stuff with Python by Al Sweigart. It is also free-to-read online or you can buy the book. Automate-the-Boring-Stuff focuses on the useful aspect of Python, while still being very accessible to beginners.

You should also become familiar with the official Python documentation, it is well developed and comprehensive, if necessarily not very accessible for beginners. You should start with the official Python Tutorial, that’s were I started to learn Python myself (around 15 years ago.) The Glossary is also useful, to cope with terminology confusion.

As you learn more, you will need to become familiar with the Python Standard Library, this contains many of the built-in tools that make Python so useful. The Python Module of the Week series of articles are very helpful for understanding how to use the standard library. The Python documentation also contains some useful how-to articles that help explain some Python details. I find the regex how-to particularly useful (if you don’t know what a “regex” is, don’t worry, you will learn about these very useful and tricky tools soon…)

Other useful resources

PyVideo is a repository of presentations at various Python conferences around the world. Browsing the videos should give you some idea of the many interesting things people are doing with Python. There are also many video tutorials available.

And now for something completely different…

Here is some Python source code, see if you can figure out what it does by reading it: