Hacking Secret Ciphers with Python

(Ann) #1
Chapter 2 – Downloading and Installing Python 19

If your operating system is Ubuntu or Linux, start IDLE by clicking Applications ► Accessories
► Terminal and then type idle3. You may also be able to click on Applications at the top of
the screen, and then select Programming and then IDLE 3.


Figure 2-2. IDLE running on Windows (left), OS X (center), and Ubuntu Linux (right).

The window that appears will be mostly blank except for text that looks something like this:


Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:57:17) [MSC v.1600 64 bit
(AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.








The window that appears when you first run IDLE is called the interactive shell. A shell is a
program that lets you type instructions into the computer. The Python shell lets you type Python
instructions in and then sends these instructions to the Python interpreter software to run. We can
type Python instructions into the shell and, because the shell is interactive, the computer will read
our instructions and perform them immediately.


The Featured Programs


“Hacking Secret Ciphers with Python” is different from other programming books because it
focuses on the source code for complete programs. Instead of teaching you programming
concepts and leaving it up to you to figure out how to make your own programs, this book shows
you complete programs and explains how they work.


As you read through this book, type the source code from this book into IDLE yourself. But you
can also download the source code files from this book’s website. Go to the web site
http://invpy.com/hackingsource and follow the instructions to download the source code files.


In general, you should read this book from front to back. The programming concepts build on
the previous chapters. However, Python is such a readable language that after the first few
chapters you can probably piece together what the code does. If you jump ahead and feel lost, try

Free download pdf