In the next sections and chapters, we will be writing different pieces of Python code that will subscribe to topics and will also publish messages to topics. As happens whenever we want to isolate an environment that requires additional packages, it is convenient to work with Python virtual environments. Python 3.3 introduced lightweight virtual environments, and they were improved in Python 3.4. We will work with these virtual environments, and therefore, you will need Python 3.4 or greater. You can read more about PEP 405 Python Virtual Environment, which introduced the venv module, here: https://www.python.org/dev/peps/pep-0405.
All the examples for this book were tested on Python 3.6.2 on macOS and Linux. The examples were also tested on the IoT boards mentioned throughout the book and their most popular operating...