Adding the application's entry point

This is the section of this chapter that we all have been waiting for; we are going to create the application entry point and glue together all the pieces of code that we have written so far.

Let's create a file called __main__.py in the currency_converter/currency_converter directory. We have already used the _main__ file before in Chapter 1, Implementing the Weather Application. When we place a file called __main__.py in the module's root directory, it means that that file is the entry script of the module. So, if we run the following command:

python -m currency_converter 

It is the same as running:

python currency_converter/__main__.py

Great! So, let's start adding content to this file. First, add some ...

Get Python Programming Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.