Try Out Different Versions of Python with Docker

Intuitive Python — by David Muller (10 / 41)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Using Python’s Interactive Console to Run Progr ams | TOC | Investigating with pdb Breakpoints 👉

The maintainers of Python regularly release improved versions of the language. New versions of Python frequently contain new modules and performance improvements. One of the easiest ways to try out these new Python versions is with Docker.

You may already be familiar with Docker, or have just tried it out by using this book’s companion image introduced in Setting Up Your Environment and Using This Book’s Companion Docker Image.

In case you aren’t familiar: Docker is a virtualization technology that lets you bundle code and packages together in an image and run them in something called a container. Docker images are static bundles of code and packages, and Docker containers are the running version of an image. For the purposes of this section, you can think of Docker containers as lightweight and isolated virtual machines that you can start quickly and throw away when you’re done with them.

It will be easier to understand the power of Docker if we look at two brief examples using official Docker images published by the Python language maintainers.[16]

If you’d like to run these examples along on your computer, first install Docker by downloading it from the Docker website.[17]

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.