Page 437 - Beginning Programming with Pyth - John Paul Mueller
P. 437
has certain deficiencies. Of course, the biggest deficiency is that the Python shell is a pure text environment in which you must type commands to perform any given task. A more advanced shell, such as IPython (http://ipython.org/), can make the interactive environment friendlier by providing GUI features so that you don’t have to remember the syntax for odd commands.
IPython is actually more than just a simple shell. It provides an environment in which you can interact with Python in new ways, such as by displaying graphics that show the result of formulas you create using Python. In addition, IPython is designed as a kind of front end that can accommodate other languages. The IPython application actually sends commands to the real shell in the background, so you can use shells from other languages such as Julia and Haskell. (Don’t worry if you’ve never heard of these languages.)
One of the more exciting features of IPython is the ability to work in parallel computing environments. Normally a shell is single threaded, which means that you can’t perform any sort of parallel computing. In fact, you can’t even create a multithreaded environment. This feature alone makes IPython worthy of a trial.
Testing Python Applications by Using PyUnit
At some point, you need to test your applications to ensure that they work as instructed. You can test them by entering in one command at a time and verifying the result, or you can automate the process. Obviously, the automated approach is better because you really do want to get home for dinner someday and manual testing is really, really slow (especially when you make mistakes, which are guaranteed to happen). Products such as PyUnit (https://wiki.python.org/moin/PyUnit) make unit testing (the testing of individual features) significantly easier.
The nice part of this product is that you actually create Python code to perform the testing. Your script is simply another, specialized,