You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/intro.md
+13-10Lines changed: 13 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ Publish to conda-forge <7-publish-conda-forge>
38
38
39
39
```
40
40
41
-
## What is a Python package?
41
+
42
42
43
43
:::{admonition} Learning Objectives
44
44
@@ -51,18 +51,21 @@ After reading this lesson you will:
51
51
52
52
:::
53
53
54
-
A Python package is a collection of related modules / code containing
55
-
functions, classes and methods that are organized together in a directory.
56
-
Packages allow you to group and structure your Python code, making it easier
57
-
to manage and reuse code across different projects.
54
+
Breakout?? - You might also hear people use the term "library" the same way.
55
+
56
+
## What is a Python package?
57
+
58
+
At a high level, you can think about a Python package as a toolbox.
58
59
59
-
A package is installable, which means that you can add the functionality within
60
+
In Python, the term package has a specific meaning: it is a directory with a certain structure. The directory contains modules which are files that end in `.py`. Each module contains functions and classes, that you can think about as tools in your toolbox.
61
+
62
+
The modules within a package allow you to group and structure your
63
+
Python code. A package is installable, which means that you can add the functionality within
60
64
the package code to any Python environment and import that functionality like
61
-
you would import NumPy or matplotlib.
65
+
you would import NumPy or matplotlib. This also makes it easier
66
+
to manage and reuse code across different projects.
62
67
63
-
At a high level, you can think about each package as a toolbox filled with
64
-
different tools that perform specific actions in your code when imported and
65
-
called.
68
+
Structuring your code as a package is the first step you need to take so you can share the tools in the toolbox you've created and let others build with it.
0 commit comments