Skip to content

Commit 7232dee

Browse files
committed
KISS
1 parent b8928e2 commit 7232dee

7 files changed

Lines changed: 1 addition & 38 deletions

File tree

‎python/06-modules.py‎

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -154,32 +154,4 @@
154154
#https://stackoverflow.com/questions/30218802/get-parent-of-current-directory-from-python-script/39618108
155155
from os.path import dirname, abspath
156156
d = dirname(dirname(abspath(__file__)))
157-
sys.path.append(d)
158-
159-
160-
########## Packages ##########
161-
162-
163-
#If you look in the directory of modules and take a gander
164-
#You'll notice some are directories while others are .py files
165-
#The ones that are directories are known as packages.
166-
#importing and using is same, creation is slightly different as mult. files combined
167-
168-
#for example, tkinter, a GUI tool, is a folder.
169-
#open it up and see a bunch of components and __init__.py to wrap it up.
170-
import ultimate_utils.list_utils
171-
import ultimate_utils.math_utils
172-
173-
ultimate_utils.list_utils.print_2d([[1,2, 3], [4, 5, 6], [7, 8, 9]])
174-
175-
#list_utils.print_2d([[9, 9, 9],[9, 9, 9]]) error
176-
#It would be ideal if we could work with list_utils directly.
177-
from ultimate_utils import * #doesn't work by default.
178-
#This is where __all__ comes in inside __init__.py
179-
list_utils.print_2d([[9, 9, 9],[9, 9, 9]])
180-
181-
#Brief bit on compilation
182-
#going through this process you may have noticed a __psycache__ folder
183-
#https://docs.python.org/3/tutorial/modules.html#compiled-python-files
184-
#"To speed up loading modules, Python caches the compiled version of each module"
185-
#enough on this tho, my brain hurts.
157+
sys.path.append(d)

‎python/ultimate_utils/__init__.py‎

Lines changed: 0 additions & 1 deletion
This file was deleted.
-187 Bytes
Binary file not shown.
-331 Bytes
Binary file not shown.
-305 Bytes
Binary file not shown.

‎python/ultimate_utils/list_utils.py‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎python/ultimate_utils/math_utils.py‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)