Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with Python and Raspberry Pi (Redirected from Learning Python By Developing Raspberry Pi Applications)

You're reading from   Getting Started with Python and Raspberry Pi (Redirected from Learning Python By Developing Raspberry Pi Applications) Learn to design and implement reliable Python applications on the Raspberry Pi using a range of external libraries, the Raspberry Pis GPIO port, and the camera module

Arrow left icon
Product type Paperback
Published in Sep 2015
Publisher
ISBN-13 9781783551590
Length 200 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Dan Nixon Dan Nixon
Author Profile Icon Dan Nixon
Dan Nixon
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Your First Steps with Python on the Pi FREE CHAPTER 2. Understanding Control Flow and Data Types 3. Working with Data Structures and I/O 4. Understanding Object-oriented Programming and Threading 5. Packaging Code with setuptools 6. Accessing the GPIO Pins 7. Using the Camera Module 8. Extracting Data from the Internet 9. Creating Command-line Interfaces 10. Debugging Applications with PDB and Log Files 11. Designing Your GUI with Qt Index

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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime