Skip to content

Commit 486dd80

Browse files
committed
Add tutorial materials
1 parent fbafeff commit 486dd80

File tree

7 files changed

+38
-0
lines changed

7 files changed

+38
-0
lines changed

python-init-py/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# What Is Python's `__init__.py` For?
2+
3+
This folder contains the code discussed in the Real Python tutorial on [Python's `__init__.py` file](https://realpython.com/python-init-py/).
4+
5+
You can start a Python interpreter inside this folder, then interact with the modules like shown in the tutorial.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# print(f"Importing {__name__}")
2+
3+
__version__ = "0.1.0"
4+
5+
from .audio.utils import enhance as audio_enhance
6+
from .audio.utils import wobbulate
7+
from .graphics.utils import enhance as graphics_enhance
8+
from .graphics.utils import solarize
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# print(f"Importing {__name__}")
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# print(f"Importing {__name__}")
2+
3+
def wobbulate():
4+
print("Wibble wobble")
5+
6+
def enhance():
7+
print("Enhancing audio")
8+
9+
_secret_password = "Alakazam!"
10+
__top_secret_password = "!mazakalA"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# print(f"Importing {__name__}")
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# print(f"Importing {__name__}")
2+
3+
__all__ = ["solarize", "enhance"]
4+
5+
def solarize():
6+
print("Solarizing")
7+
8+
def enhance():
9+
print("Enhancing graphics")
10+
11+
indiana_pi = 3.2
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
__version__ = "1.0.0"
2+
magic_number = 42

0 commit comments

Comments
 (0)