This appendix assumes that you have already set up a Python environment and OpenCV's Python bindings, as instructed in Chapter 1, Preparing for the Mission. Now, if you are new to Python, you are probably wondering how to test this environment and run Python code.
Python offers an interactive interpreter, so you can test code without even having to save your source code to a file. Open the operating system's Terminal or Command Prompt, and enter the following command:
$ python
Python will print its version information and then show a prompt, >>>, for its interactive interpreter. You can enter code at this prompt and Python will print the code's return value, if any. For example, if we enter 1+1, we should see the following text:
>>> 1+1
2
Now, let's try to import the OpenCV Python module, which...