Python programming
Autor Principal: | |
---|---|
Formato: | Libro |
Lengua: | inglés |
Datos de publicación: |
Boston :
Premier,
c2003
|
Edición: | 1st ed. |
Series: | For the absolute beginner
|
Temas: | |
Acceso en línea: | Consultar en el Cátalogo |
Notas: | Incluye índice. |
Descripción Física: | xxviii, 452 p. : il. |
ISBN: | 1592000738 |
Tabla de Contenidos:
- Introduction
- 1. Getting Started: The Game over Program
- Examining the Game Over Program
- Introducing Python
- Setting Up Python on Windows
- Setting Up Python on Other Operating Systems
- Introducing the Python IDLE
- Back to the Game Over Program
- Summary
- 2. Types, Variables, and Simple I/O: The Useless Trivia Program
- Introducing the Useless Trivia Program
- Using Quotes with Strings
- Using Escape Sequences with Strings
- Concatenating and Repeating Strings
- Working with Numbers
- Understanding Variables
- Getting User Input
- Using String Methods
- Using the Right Types
- Converting Values
- Back to the Useless Trivia Program
- Summary
- 3. Branching, while Loops, and Program Planning: The Guess My Number Game
- Introducing the Guess My Number Game
- Generating Random Numbers
- Using the if Structure
- Using the if-else Structure
- Using the if-elif-else Structure
- Creating while Loops
- Avoiding Infinite Loops
- Treating Values as Conditions
- Creating Intentional Infinite Loops
- Using Compound Conditions
- Planning Your Programs
- Returning to the Guess My Number Game
- Summary
- 4. for Loops, Strings, and Tuples: The Word Jumble Game
- Introducing the Word Jumble Game
- Using for Loops
- Counting with a for Loop
- Using Sequence Operators and Functions with Strings
- Indexing Strings
- Understanding String Immutability
- Building a New String
- Slicing Strings
- Creating Tuples
- Using Tuples
- Back to the Word Jumble Game
- Summary
- 5. Lists and Dictionaries: The Hangman Game
- Introducing the Hangman Game
- Using Lists
- Using List Methods
- Understanding When to Use Tuples Instead of Lists
- Using Nested Sequences
- Understanding Shared References
- Using Dictionaries
- Back to the Hangman Game
- Summary
- 6. Functions: The Tic-Tac-Toe Game
- Introducing the Tic-Tac-Toe Game
- Creating Functions
- Using Parameters and Return Values
- Using Keyword Arguments and Default Parameter Values
- Using Global Variables and Constants
- Back to the Tic-Tac-Toe Game
- Summary
- 7. Files and Exceptions: The Trivia Challenge Game
- Introducing the Trivia Challenge Game
- Reading from Text Files
- Writing to a Text File
- Storing Complex Data in Files
- Handling Exceptions
- Back to the Trivia Challenge Game
- Summary
- 8. Software Objects: The Critter Caretaker Program
- Introducing the Critter Caretaker Program
- Understanding Object-Oriented Basics
- Creating Classes, Methods, and Objects
- Using Constructors
- Using Attributes
- Using Class Attributes and Static Methods
- Understanding Object Encapsulation
- Using Private Attributes and Private Methods
- Understanding New-Style and Old-Style Classes
- Controlling Attribute Access
- Back to the Critter Caretaker Program
- Summary
- 9. Object-Oriented Programming: The Blackjack Game
- Introducing the Blackjack Game
- Sending and Receiving Messages
- Combining Objects
- Using Inheritance to Create New Classes
- Extending a Class through Inheritance
- Altering the Behavior of Inherited Methods
- Understanding Polymorphism
- Creating Modules
- Back to the Blackjack Game
- Summary
- 10. GUI Development: The Mad Lib Program
- Introducing the Mad Lib Program
- Examining a GUI
- Understanding Event-Driven Programming
- Using a Root Window
- Using Labels
- Using Buttons
- Creating a GUI Using a Class
- Binding Widgets and Event Handlers
- Using Text and Entry Widgets and the Grid Layout Manager
- Using Check Buttons
- Using Radio Buttons
- Back to the Mad Lib Program
- Summary
- 11. Graphics: The Pizza Panic Game
- Introducing the Pizza Panic Game
- Introducing the Pygame and LiveWires Packages
- Creating a Graphics Window
- Setting a Background Image
- Understanding the Graphics Coordinate System
- Displaying Text
- Displaying a Message
- Understanding the Games_Object Class
- Displaying a Sprite
- Moving Sprites
- Dealing with Screen Boundaries
- Handling Mouse Input
- Detecting Collisions
- Back to the Pizza Panic Game
- Summary
- 12. Sound, Animation, and Program Development: The Astrocrash Game
- Introducing the Astrocrash Game
- Reading the Keyboard
- Rotating a Sprite
- Creating an Animation
- Working with Sound and Music
- Planning the Astrocrash Game
- Creating Asteroids
- Rotating the Ship
- Moving the Ship
- Firing Missiles
- Controlling the Missile Fire Rate
- Handling Collisions
- Adding Explosions
- Adding Levels, Scorekeeping, and Theme Music
- Summary
- Appendix A: LiveWires Reference
- games Module functions
- games Module Constants
- color Module Constants
- Index