TOOLS FOR PYTHON
The Anaconda Python distribution available for Windows, Linux, and Mac is downloadable at http://continuum.io/downloads.
Anaconda is well-suited for modules such as numpy and scipy, and if you are a Windows user, Anaconda appears to be a better alternative.
easy_install and pip
Both easy_install and pip are easy to use when you need to install Python modules. Whenever you need to install a module (and there are many in this book), use either easy_install or pip with the following syntax:
easy_install <module-name> pip install <module-name>
NOTE Python-based modules are easier to install, whereas modules with code written in C are usually faster but more difficult in terms of installation.
virtualenv
The virtualenv tool enables you to create isolated Python environments, and its home page is at http://www.virtualenv.org/en/latest/virtualenv.html.
virtualenv addresses the problem of preserving the correct dependencies and versions (and indirectly, permissions) for different applications. If you are a Python novice, you might not need virtualenv right now, but keep this tool in mind.
IPython
Another very good tool is IPython (which won a Jolt award), and its home page is at http://ipython.org/install.html. Two very nice features of IPython are tab expansion and “?” (textual assistance). An example of tab expansion is shown here:
python Python 3.9.1 (v3.9.1:1e5d33e9b9, Dec 7 2020, 12:44:01) [Clang 12.0.0 (clang-1200.0.32.27)] on darwin Type "help", "copyright", "credits" or "license" for more information. IPython 0.13.2 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]: di %dirs dict dir divmod
In the preceding session, if you type the characters di, IPython responds with the following line that contains all the functions that start with the letters di:
%dirs dict dir divmod
If you enter a question mark (“?”), IPython provides textual assistance, the first part of which is here:
IPython -- An enhanced Interactive Python ========================================= IPython offers a combination of convenient shell features,
special commands and a history mechanism for both input
(command history) and output (results caching, similar
to Mathematica). It is intended to be a fully compatible
replacement for the standard Python interpreter, while
offering vastly improved functionality and flexibility.
The next section shows you how to check whether Python is installed on your machine, and also where you can download Python.