[Tutor] if __name__=='main' vs entry points: What to teach new comers?

Thomas Güttler guettliml at thomas-guettler.de
Wed Aug 2 05:06:37 EDT 2017



Am 02.08.2017 um 05:51 schrieb Steven D'Aprano:
> 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 :-)

Maybe I am doing something wrong.  I was proud because I did use “console_scripts” entry points.
I thought this is the right way of doing it. Doing things the right way always makes my feel so very good :-)

Regards,
   Thomas


-- 
Thomas Guettler http://www.thomas-guettler.de/


More information about the Tutor mailing list