Skip to content Skip to sidebar Skip to footer

Pros And Cons Of 'script' Vs. 'entry_point' In Python Command Line Scripts

Python's setuptool has two ways of adding command line scripts to a Python package: script and entry_point. This tutorial outlines these ways: scripts Add a Python script (funniest

Solution 1:

Basically scripts is the old way which requires you to have a stand-alone, executable script file and the entry-points method lets you define which functions you want to run when a command is given. This way you can have several functions in the same file/module and then have 'entry points' which will be called when the user types in one of the console_scripts commands.

Although setup() supports a scripts keyword for pointing to pre-made scripts to install, the recommended approach to achieve cross-platform compatibility is to use console_scripts entry points (see below).

From https://packaging.python.org/tutorials/distributing-packages/#scripts (old source)


Post a Comment for "Pros And Cons Of 'script' Vs. 'entry_point' In Python Command Line Scripts"