Page 119 - Beginning Programming with Pyth - John Paul Mueller
P. 119
At the bottom of the Help menu, you see the usual About entry. This entry displays a dialog box telling you all about your installation. In some cases, you need this information to obtain help from other Anaconda users. The most important bits of information are the version of Python and Anaconda that you’re currently using.
The remainder of the Help menu entries will depend on what you have installed at any given time. Each of these entries is for a specific Python feature (starting with the Python language itself). You generally see all the common libraries as well, such as NumPy and SciPy. All these help entries are designed to make it easier for you to obtain help in creating great code.
Chapters 1
CONSIDERING THE IPYTHON ALTERNATIVE
through
3
of the book provide insights into using the command-line version of
Python. The command shell IPython looks and acts much like the command line provided with
Python, but it has a number of interesting add-ons. The most noticeable of these add-ons is the
use of color coding for code you type (reducing your chances of making an error). For example,
commands appear in green and text appears in yellow. The interface also highlights matching
parentheses and other block elements so that you can actually see which block element you’re
closing.
The help system is another difference between the Python command line and IPython. You get
additional access to help, and the information you receive is more detailed. One of the more
interesting features in this case is the use of the question mark after the name of any Python
object. For example, if you type
print?
and press Enter, you see a quick overview of the
command. Type
and press Enter to see the IPython-specific help overview.
print() ?
Using the Magic Functions
Notebook and its counterpart, IPython, provide you with some special functionality in the form of magic functions. It's kind of amazing to think that these applications offer you magic, but that’s precisely what you get with the magic functions. The magic is in the output. For
In contrast to the Python command line, IPython also supports many of the Notebook advanced
features, such as magic functions, which the “
Using the Magic Functions
” section of the chapter
discusses. These special functions enable you to change how IPython and Notebook display
various kinds of Python output, among other things. In sum, when you do need to use a
command line, use IPython instead of the command line supplied with Python to obtain added
functionality.