Script or library - from import
examples/modules/import_from_mymodule.py
from mymodule import run print("Name space in import_mymodule.py ", __name__) run()
$ python import_from_mymodule.py Name space in mymodule.py mymodule Name space in import_mymodule.py __main__ run in mymodule