Book Image

Getting Started with Python and Raspberry Pi (Redirected from Learning Python By Developing Raspberry Pi Applications)

By : Dan Nixon
Book Image

Getting Started with Python and Raspberry Pi (Redirected from Learning Python By Developing Raspberry Pi Applications)

By: Dan Nixon

Overview of this book

Table of Contents (18 chapters)
Getting Started with Python and Raspberry Pi
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Object-oriented programming


Object-oriented programming is a paradigm in which the program is structured around several objects rather than actions or functionality. The main difference is that in the procedural programming type that we have been using so far in the book, the focus is on the processing that is being carried out, whereas in object-oriented programming, the focus is on the data being processed.

To demonstrate this, we will write a simple module that provides an interface similar to a conventional calculator, that is, input in the form of a series of numerical values and operations.

The structure for this module is shown in the following Unified Modeling Language (UML) (www.uml.org) diagram:

Here each block represents a class, with the second square representing the member variables of the class and the bottom representing the functions.

An arrow indicates that a class inherits from the class it points to. This essentially means that the class inherits all of the parent class...