Object-Oriented Python: Master OOP by Building Games and GUIs

  • 6h 12m
  • Irv Kalb
  • No Starch Press
  • 2022

Object-Oriented Programming (OOP) is a paradigm that combines data and code into cohesive units, allowing you to think differently about computational problems and solve them in a highly reusable way. Aimed at intermediate-level programmers, Object-Oriented Python is a hands-on tutorial that goes deep into the core tenets of OOP, showing you how to use encapsulation, polymorphism, and inheritance to write games and apps using Python.

The book begins by demonstrating key problems inherent in procedural programming, then guides you through the basics of creating classes and objects in Python. You’ll build on this groundwork by developing buttons, text fields, and other GUI elements that are standard in event-driven environments. You’ll also use many real-world code examples and two pygame-based packages to help turn theory into practice, enabling you to easily write interactive games and applications complete with GUI widgets, animations, multiple scenes, and reusable game logic. In the final chapter, you’ll bring it all together by building a fully functional video game that incorporates many of the OOP techniques and GUI elements covered in the book.

You’ll learn how to:

  • Create and manage multiple objects using an object manager object
  • Use encapsulation to hide the inner details of objects from client code
  • Use polymorphism to define one interface and implement it in multiple classes
  • Apply inheritance to build on existing code

Object-Oriented Python is a visual, intuitive guide to fully understanding how OOP operates and how you can use it to make your code more maintainable, readable, and efficient—without sacrificing functionality.

About the Author

Irv Kalb is an adjunct professor at UCSC-Extension and University of Silicon Valley (formerly Cogswell College), where he teaches introductory and object-oriented programming courses in Python. Kalb has a bachelor's and master's degree in Computer Science, decades of experience developing software while focusing on educational software, and has been teaching for over 10 years. He is the author of Learn to Program with Python 3: A Step-by-Step Guide to Programming (Apress).

In this Book

  • Introduction
  • Procedural Python Examples
  • Modeling Physical Objects with Object-Oriented Programming
  • Mental Models of Objects and the Meaning of “self”
  • Managing Multiple Objects
  • Introduction to Pygame
  • Object-Oriented Pygame
  • Pygame GUI Widgets
  • Encapsulation
  • Polymorphism
  • Inheritance
  • Managing Memory Used by Objects
  • Card Games
  • Timers
  • Animation
  • Scenes
  • Full Game—Dodger
  • Design Patterns and Wrap-Up
SHOW MORE
FREE ACCESS

YOU MIGHT ALSO LIKE

Rating 4.5 of 122 users Rating 4.5 of 122 users (122)
Rating 5.0 of 1 users Rating 5.0 of 1 users (1)