Chapter One
Introducing Python * Powerful yet easy to use programming language * Developed by Guido van Rossum * First released in 1991 * Named after comedy troupe Monty Python * An alarming number of references to spam, eggs, and the number 42 in documentation
Why Python? It’s Easy to Use
* High-level language: Distinct from the low-level processor operations; closer to human language than machine language * "Programming at the speed of thought" * Increases productivity * Python programs three to five times shorter than Java * Python programs five to ten times shorter than C++ * Normally, “Programming is like making fine furniture with an axe and a nail file.” * Python makes it more like working with a table saw & a lathe * You still have to learn how to use them, but they’re the right tools for the job
Python Is Easy to Use
* Python Program print "Game Over!" * C++ Program
#include <iostream> int main()
{
std::cout << "Game Over!" << std::endl; return 0;
}
Python Is Powerful
* Used by large organizations * NASA * Google * Microsoft * Used in published games * Battlefield 2 * Civilization IV * Disney’s Toontown Online * Used throughout academia and the scientific community
Python Is Object-Oriented
* Object-oriented programming (OOP): Methodology that defines problems in terms of objects that send messages to each other * In a game, a Missile object could send a Ship object a message to Explode * OOP not required, unlike Java and C#
Python Is a “Glue” Language
* Can be integrated with other languages * C/C++ * Java * Use existing code * Leverage strengths of other languages * Extra speed that C or C++ offers
Python Runs Everywhere
* Platform independent: Independent of the specific computer