NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
The Simplest Possible Way To Make A Python File Into A Package That's Importable From Anywhere | |
~~~ A Guide For (And By) the Incurably Befuddled ~~~ | |
============================================================================================== | |
SCENARIO: while writing a one-shot project, you construct a module named LovelyCoconut.py. | |
#main.py | |
import LovelyCoconut | |
LovelyCoconut.bang_halves_together() |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].