Skip to Content
Python GUI Programming with Tkinter
book

Python GUI Programming with Tkinter

by Alan D. Moore
May 2018
Beginner to intermediate content levelBeginner to intermediate
452 pages
11h 26m
English
Packt Publishing
Content preview from Python GUI Programming with Tkinter

Adding extra files

By default, setuptools will only copy Python files into your package. Our package contains more than that, though: we have documentation in RST, SQL scripts, and most importantly our PNG images, without which our program won't run.

Non-Python files inside our package can be specified using the package_data argument as follows:

setup(    #...        package_data={'abq_data_entry.images': ['*.png']},

The package_data argument takes a dictionary that matches module paths to a list of files or globbing expressions to be included in that module. Here, we're telling setuptools to include all the PNG files in the images module.

Our project contains other files outside the abq_data_entry module, which aren't needed for the program to operate, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python GUI Programming with Tkinter - Second Edition

Python GUI Programming with Tkinter - Second Edition

Alan D. Moore

Publisher Resources

ISBN: 9781788835886Supplemental Content