diff --git a/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/SubPackage/__init__.py b/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/SubPackage/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/SubPackage/__pycache__/__init__.cpython-36.pyc b/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/SubPackage/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 000000000..d4fedf2ca Binary files /dev/null and b/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/SubPackage/__pycache__/__init__.cpython-36.pyc differ diff --git a/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/SubPackage/__pycache__/mysubscript.cpython-36.pyc b/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/SubPackage/__pycache__/mysubscript.cpython-36.pyc new file mode 100644 index 000000000..24a8ba483 Binary files /dev/null and b/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/SubPackage/__pycache__/mysubscript.cpython-36.pyc differ diff --git a/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/SubPackage/mysubscript.py b/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/SubPackage/mysubscript.py new file mode 100644 index 000000000..0c4217ffe --- /dev/null +++ b/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/SubPackage/mysubscript.py @@ -0,0 +1,2 @@ +def sub_report(): + print("Hey Im a function inside mysubscript") \ No newline at end of file diff --git a/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/__init__.py b/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/__pycache__/__init__.cpython-36.pyc b/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 000000000..36ec225ce Binary files /dev/null and b/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/__pycache__/__init__.cpython-36.pyc differ diff --git a/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/__pycache__/some_main_script.cpython-36.pyc b/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/__pycache__/some_main_script.cpython-36.pyc new file mode 100644 index 000000000..c0b08646a Binary files /dev/null and b/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/__pycache__/some_main_script.cpython-36.pyc differ diff --git a/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/some_main_script.py b/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/some_main_script.py new file mode 100644 index 000000000..b1c7287ac --- /dev/null +++ b/06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/some_main_script.py @@ -0,0 +1,2 @@ +def report_main(): + print("Hey I am in some_main_script in main package.") \ No newline at end of file diff --git a/06-Modules and Packages/00-Modules_and_Packages/mymodule.py b/06-Modules and Packages/00-Modules_and_Packages/mymodule.py index 6661fd81a..5970453b8 100644 --- a/06-Modules and Packages/00-Modules_and_Packages/mymodule.py +++ b/06-Modules and Packages/00-Modules_and_Packages/mymodule.py @@ -1,5 +1,2 @@ -# This is the module we will be importing from! -# Great resource: https://docs.python.org/3/tutorial/modules.html - -def func_in_mymodule(): - print("I am a function inside of the mymodule.py file!") +def my_func(): + print("Hey I am in mymodule.py") \ No newline at end of file diff --git a/06-Modules and Packages/00-Modules_and_Packages/myprogram.py b/06-Modules and Packages/00-Modules_and_Packages/myprogram.py index 20790d389..e08a2cb0d 100644 --- a/06-Modules and Packages/00-Modules_and_Packages/myprogram.py +++ b/06-Modules and Packages/00-Modules_and_Packages/myprogram.py @@ -1,34 +1,6 @@ -################ -# Example Three: -################ -# Uncomment this and comment everything else to run! +from MyMainPackage.some_main_script import report_main +from MyMainPackage.SubPackage import mysubscript -# import mymodule -# mymodule.func_in_mymodule() +report_main() -################ -# Example Two: -################ -# Uncomment this and comment everything else to run! - -# import mymodule as mm -# mm.func_in_mymodule() - -################ -# Example Three: -################ -# Uncomment this and comment everything else to run! - -# from mymodule import func_in_mymodule -# func_in_mymodule() - -################ -# Example Four: -################ -# Uncomment this and comment everything else to run! - -# This is posisble but frowned upon, often causes poorly readable code because -# you don't know what functions come from mymodule - -# from mymodule import * -# func_in_mymodule() +mysubscript.sub_report()