4 ms·
Absolutely--that's a great example of a library module that may also be usefully executed. I had something similar today: a module that sends email. It's usef
by jzwinck 13y ago
Absolutely--that's a great example of a library module that may also be usefully executed. I had something similar today: a module that sends email. It's useful to be able to run it (by explicit "python foo.py", not chmod +x) and see a sample email in my inbox.
Unfortunately, for every good use of this trick, there seem to be two poor ones. Oh well. Most of the things in TFA are more generally applicable.