Skip to Content
Mastering Python
book

Mastering Python

by Rick Hattem
April 2016
Intermediate to advanced content levelIntermediate to advanced
486 pages
9h 21m
English
Packt Publishing
Content preview from Mastering Python

Entry points

The entry_points parameter is arguably the most useful feature of setuptools. It allows you to add hooks to many things within setuptools but the most useful two are the possibility to add both the command line and GUI commands and to extend the setuptools commands. The command line and GUI commands will even be converted to executables on Windows. The example in the first section already demonstrated both the features:

entry_points={
    'distutils.commands': [
        'command_name = your_package:YourClass',
    ],
    'console_scripts': [
        'spam = your_package:SpamClass',
    ],
},

This demonstration only shows how to call the functions but it doesn't show the actual functions.

Creating global commands

The first, a simple example, is nothing special at all; ...

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

Advanced Python Programming

Advanced Python Programming

Dr. Gabriele Lanaro, Quan Nguyen, Sakis Kasampalis
Getting Started with Python

Getting Started with Python

Fabrizio Romano, Benjamin Baka, Dusty Phillips
Python for Geeks

Python for Geeks

Muhammad Asif

Publisher Resources

ISBN: 9781785289729Supplemental Content