forked from Pierian-Data/Complete-Python-3-Bootcamp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1cef96f
commit 72797a6
Showing
10 changed files
with
10 additions
and
37 deletions.
There are no files selected for viewing
Empty file.
Binary file added
BIN
+144 Bytes
...ages/00-Modules_and_Packages/MyMainPackage/SubPackage/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file added
BIN
+293 Bytes
...s/00-Modules_and_Packages/MyMainPackage/SubPackage/__pycache__/mysubscript.cpython-36.pyc
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/SubPackage/mysubscript.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def sub_report(): | ||
print("Hey Im a function inside mysubscript") |
Empty file.
Binary file added
BIN
+133 Bytes
...es and Packages/00-Modules_and_Packages/MyMainPackage/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file added
BIN
+297 Bytes
...ackages/00-Modules_and_Packages/MyMainPackage/__pycache__/some_main_script.cpython-36.pyc
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/some_main_script.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def report_main(): | ||
print("Hey I am in some_main_script in main package.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |
36 changes: 4 additions & 32 deletions
36
06-Modules and Packages/00-Modules_and_Packages/myprogram.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |