[Tutor] if __name__=='main' vs entry points: What to teach new comers?
Steven D'Aprano
steve at pearwood.info
Wed Aug 2 10:57:41 EDT 2017
On Wed, Aug 02, 2017 at 10:48:39PM +1000, Ben Finney wrote:
> Thomas Güttler <guettliml at thomas-guettler.de> writes:
>
> > Maybe I am doing something wrong. I was proud because I did use
> > “console_scripts” entry points.
>
> Did someone lead you to believe it was wrong? Setuptools console_scripts
> entry points are a good tool.
>
> My point was that it is an *advanced* tool, difficult to use and also
> difficult to explain because the concepts are advanced.
Can you explain the use-case for when somebody might want to use
console_scripts entry points?
I have a module with a main() function and an "if __name__ == ..."
guard. Under what circumstances is that not sufficient, and I would want
console_scripts?
--
Steve
More information about the Tutor
mailing list