Python, the "Glue" of Debian and Ubuntu

is made.

Glue It All Together

Python is an advanced scripting language that is being used successfully to glue together large software components. It spans multiple platforms, middleware products, and application domains. — Glue It All Together With Python, Guido van Rossum

The father of Python, Guido, published his famous essay "Glue It All Together With Python" in 1998. People probably started to descript Python as a glue language since then.

A GNU/Linux distribution is a collection of software components, including applications and libraries. As a GNU/Linux distribution, Debian, and Debian's downstream, Ubuntu, they use Python to glue themselves.

In this post, I am going to talk about some examples of how Python works as a glue language in the (GNU/Linux Debian/Ubuntu) distributions, and the examples of how the glue of Python is made. By understanding the glue role of Python in these distributions, it will profoundly help users and developers know their own distribution.

Glue as Scripting and Non-scripting Languages

In Guido's essay, he talks about using Python the glue as scripting and non-scripting language. These 2 types of Python usage are both commonly seen in Debian/Ubuntu. We will talk about both of them.

The Glue and Non-glue Python of Debian/Ubuntu

Always make sure you are dealing with the Python of glue or the Python of non-glue. By glue and non-glue, I mean:

For example, your system default python e.g. /usr/bin/python or /usr/bin/python3, is the glue of your distribution (don't remove them! Or you will be very miserable). The python interpreter you built or installed(, and/or its python virtual environment) is usually the non-glue python of your distribution. You can freely remove or destroy them without worrying too much. For example, you don't need to worry that you can't boot to your desktop.

The concept for the other facelets of Python is the same, e.g. libraries and applications. The judgement could be: if the lack of the interpreter/libraries/applications makes your distribution malfunction, then it plays a role as glue.

Get Some Debian Packages and See Which Type They Belong To

Now it's time for us to get some debian packages and see which type they belong to. For example, are they used as a scripting language or not? Are they used to connect the other programming language? Let me show you some examples later in another post!

Easter Egg: not many people know, but Python's sys module contains embedded JavaScript code in cpython to get the user agent for NodeJS version when running in the browser. See here for the source code.