Python as a program

This post is part of the Python Crash Course series. The chronological order on how to read the articles is to be found on the agenda.

Like any other softwares

Like any other software, Python is a program that can be launched via the Terminal.

For instance, you can perfectly start a web browser session via the terminal:

zsh> open -a "Google Chrome" https://olivierbenard.fr

Same goes for Python:

zsh> python
>>> 2+2
4
>>> quit()

Software updates

Python is constantly updated; you can check the active releases and deprecated versions from the official page: https://www.python.org/downloads/.

An overview of the status for the different versions is accessible here: https://devguide.python.org/versions/.

Each version brings new functionalities to the code and correct existing bugs. Like a castle of cards, a constant improvement is going on.

For instance, the new 3.8 version brought multiple interesting features on the table such as the walrus operator and positional parameters.

A more extended view is given here: https://docs.python.org/3/whatsnew/3.8.html.

To track down each version – by convention – we use an incrementing sequence of numbers. More on that here: https://en.wikipedia.org/wiki/Software_versioning.

You can check the current installed version you might have on your system:

zsh> python --version
Python 3.11.4

As you can see, the semantic versioning has 3 components: 3.11.4 (major, minor and patch respectively).

You can have multiple python versions installed on your system. More on that here: pyenv-python-version-manager.

But that’s too much information, let’s leave it for now.

Python installation

To install python, simply pick the version you want from the official page and follow the instructions: https://www.python.org/downloads/.

I recommend going for the latest stable released version (3.12.1 at this time of writing).

Now that you have python installed, let’s start playing with it: python-via-command-line.

Leave a Reply

Your email address will not be published. Required fields are marked *