[Tutor] __main__.py file Was: if __name__=='main' vs entry points: What to teach new comers?

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


> Do both. If you’re making a package, create a __main__.py file as well
> so your package is usable with `python -m somepackage`. On the other
> hand, if you’re making things more akin to shell scripts, using just
> entry_points makes stuff harder, because you need to install the code
> (and write a setup.py), as opposed to just putting the script
> somewhere in $PATH.
> 

Up to now I never did this. Maybe I will do this in the future.

thank you,
   Thomas Güttler

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


More information about the Tutor mailing list