Combining functions into an application
So far, we looked at very useful utility functions that perform specific tasks; however, to form an application, we need to combine these functions by calling them in an ordered manner to achieve our objectives. We need code that orchestrates the calls and results—one that will make the application run.
For this, we will dive into one of the most beautiful and powerful parts of Python programming: classes and methods.
Python is an object-oriented programming language (but it is not strict). If you are not familiar with the concept of object-oriented programming, don't worry; the best way to understand what this is about is by examples, so I won't go into theories now but teach by example instead. Perform the following steps now:
- Remember the application's entry point? It's in the
Chapter2
folder, in thegeochaching_app.py
file. Open it for editing, and you should have this:# coding=utf-8 def main():print "Hello geocaching...