Book Image

Python Geospatial Development Essentials

By : Karim Bahgat
Book Image

Python Geospatial Development Essentials

By: Karim Bahgat

Overview of this book

Table of Contents (15 chapters)
Python Geospatial Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Setting up the GUI package


We begin the chapter by setting up the structural skeleton for our application GUI. This should be logically separate from the rest of our code so we give it a subpackage of its own. Inside the top level pythongis folder, create a package folder called app with an __init__.py file inside it. Have it import the rest of the modules we will be creating:

from . import builder
from . import dialogues
from . import toolkit
from . import icons 

To make our app package accessible from our top level pythongis package, we similarly need to import it in pythongis/__init__.py as follows:

from . import app

The purpose of the app package is that we should be able to define how our GUI looks and behaves, and with a single line of code, pythongis.app.run(), we should be able to invoke it. The actual definition and layout of our GUI should be contained in a module we call app/builder.py (which we return to at the end of the chapter). The builder in turn relies on a set of predefined...