Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions python-init-py/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# What Is Python's `__init__.py` For?

This folder contains the code discussed in the Real Python tutorial on [Python's `__init__.py` file](https://realpython.com/python-init-py/).

You can start a Python interpreter inside this folder, then interact with the modules like shown in the tutorial. Some of the code is currently commented-out. Follow the tutorial instructions for when to uncomment.
8 changes: 8 additions & 0 deletions python-init-py/media_project/mediatools/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# print(f"Importing {__name__}")

__version__ = "0.1.0"

# from .audio.utils import enhance as audio_enhance
# from .audio.utils import wobbulate
# from .graphics.utils import enhance as graphics_enhance
# from .graphics.utils import solarize
1 change: 1 addition & 0 deletions python-init-py/media_project/mediatools/audio/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# print(f"Importing {__name__}")
13 changes: 13 additions & 0 deletions python-init-py/media_project/mediatools/audio/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# print(f"Importing {__name__}")


def wobbulate():
print("Wibble wobble")


def enhance():
print("Enhancing audio")


_secret_password = "Alakazam!"
__top_secret_password = "!mazakalA"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# print(f"Importing {__name__}")
14 changes: 14 additions & 0 deletions python-init-py/media_project/mediatools/graphics/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# print(f"Importing {__name__}")

__all__ = ["solarize", "enhance"]


def solarize():
print("Solarizing")


def enhance():
print("Enhancing graphics")


indiana_pi = 3.2
2 changes: 2 additions & 0 deletions python-init-py/tools_project/tools/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__version__ = "1.0.0"
magic_number = 42