Commits

Panagiotis Mavrogiorgos committed 8a20ed1

initial commit

  • Participants

Comments (0)

Files changed (6)

+# This is the greet package that it is actually called.
+
+def hello(msg):
+    print("SURPRISE!!! I am ignoring your message buster...")

File main_script.py

+# Let's us see the PYTHONPATH
+import sys
+for item in sys.path:
+    print(item)
+
+print("")
+
+from my_package.my_subpackage import script_that_imports_greet
+

File my_package/__init__.py

+

File my_package/greet.py

+# this is the greet that the module "script_that_imports_greet" meant to call...
+def greet(msg):
+    print("Hello " + msg + "!!!")

File my_package/my_subpackage/__init__.py

+

File my_package/my_subpackage/script_that_imports_greet.py

+# Showing that the PYTHONPATH hasn't changed at all.
+import sys
+for item in sys.path:
+    print(item)
+
+print("\n As you can see nothing has changed in the path.\n")
+
+# greet is supposed to be somewhere in the path,
+# it is not defined where exactly
+import greet
+greet.hello("everyone")