Reader small image

You're reading from  Getting Started with Python and Raspberry Pi (Redirected from Learning Python By Developing Raspberry Pi Applications)

Product typeBook
Published inSep 2015
Reading LevelBeginner
Publisher
ISBN-139781783551590
Edition1st Edition
Languages
Right arrow
Author (1)
Dan Nixon
Dan Nixon
author image
Dan Nixon

Dan Nixon is a software and electronics engineer living in the north of England. He has past experience of creating software for data analysis, process control, and business intelligence applications. In most of these projects, Python was one of the main languages used. Dan previously authored another book on the uses of the Raspberry Pi, called Raspberry Pi Blueprints, and has worked on many personal projects that use both Python and the Raspberry Pi.
Read more about Dan Nixon

Right arrow

Packaging the code


The last step is to modify the package to include the static files used to define the user interface and add the additional entry point for launching the user interface.

Firstly, we will modify the entry_points option to include the unitconverter-ui command, as follows:

entry_points = {
    'console_scripts': ['unitconvert=unitconverter.CLI:run_cli'],
    'gui_scripts': ['unitconverter-ui=unitconverter.gui:run_gui']
}

Next, we will add the package_data option to define the static files that we wish to include in the package:

package_data = {
    '': ['*.ui']
}

In this case, we are including any file with the .ui extension anywhere in the package.

Note

Note that the package_data option is technically only required when the include_package_data option has not been set to True.

Once the package has been modified, it can be installed using the following command:

sudo python setup.py install

When this completes, you can launch the UI using the following command. Note that you may need...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Getting Started with Python and Raspberry Pi (Redirected from Learning Python By Developing Raspberry Pi Applications)
Published in: Sep 2015Publisher: ISBN-13: 9781783551590

Author (1)

author image
Dan Nixon

Dan Nixon is a software and electronics engineer living in the north of England. He has past experience of creating software for data analysis, process control, and business intelligence applications. In most of these projects, Python was one of the main languages used. Dan previously authored another book on the uses of the Raspberry Pi, called Raspberry Pi Blueprints, and has worked on many personal projects that use both Python and the Raspberry Pi.
Read more about Dan Nixon