[Tutor] if __name__=='main' vs entry points: What to teach new comers?
Steven D'Aprano
steve at pearwood.info
Tue Aug 1 23:51:39 EDT 2017
On Wed, Aug 02, 2017 at 11:22:00AM +1000, Ben Finney wrote:
> Steven D'Aprano <steve at pearwood.info> writes:
>
> > On Tue, Aug 01, 2017 at 04:54:40PM +0200, Thomas Güttler wrote:
> >
> > [...]
> > > I use Python since several years and I use console_script in
> > > entry_points of setup.py.
> >
> > What's console_script in entry_points of setup.py?
>
> It is an advanced feature in Setuptools, that allows defining a function
> in the code base as the entry point for external use.
>
> The “console_scripts” entry points tell Setuptools to, at installation
> time, create a wrapper script that invokes that function as a
> command-line program.
>
> <URL:https://setuptools.readthedocs.io/en/latest/setuptools.html#automatic-script-creation>
Thanks.
Now that I have learned that, I shall do my best to forget it :-)
--
Steve
More information about the Tutor
mailing list