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/1-installable-code.md
+16-17Lines changed: 16 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -83,12 +83,12 @@ The directory structure you’ll create in this lesson will look like this:
83
83
84
84
```bash
85
85
pyospackage/ # Your project directory
86
-
└─ pyproject.toml
87
-
└─ src/ # The source (src) directory ensures your tests always run on the installed version of your code
88
-
└── pyospackage/ # Package directory where code lives
89
-
├── __init__.py
90
-
├── add_numbers.py
91
-
└── # Add any other .py modules that you want here
86
+
└─ pyproject.toml
87
+
└─ src/ # The source (src) directory ensures your tests always run on the installed version of your code
88
+
└── pyospackage/ # Package directory where code lives
89
+
├── __init__.py
90
+
├── add_numbers.py
91
+
└── # Add any other .py modules that you want here
92
92
```
93
93
94
94
### About the basic package directory structure
@@ -195,15 +195,15 @@ Your final project directory structure should look like this:
195
195
196
196
```bash
197
197
pyospackage/ # This is your project directory
198
-
└─ pyproject.toml
199
-
└─ src/ # This is your package directory where your code lives
200
-
└── pyospackage/
201
-
├── __init__.py
198
+
└─ pyproject.toml
199
+
└─ src/ # This is your package directory where your code lives
200
+
└── pyospackage/
201
+
├── __init__.py
202
202
```
203
203
204
204
## Step 2: Add code to your package
205
205
206
-
Within the `pyospackage` subdirectory, add one (1) or more Python modules (.py files) containing the code that you want your package to access and run.
206
+
Within the `pyospackage` subdirectory, add one (1) or more Python modules (.py files) containing the code that you want your package to access and run.
207
207
If you don't have code already and are just learning how to create a Python package, then create an empty `add_numbers.py` file.
208
208
209
209
:::{admonition} Python modules and the `__init__.py` file
@@ -222,12 +222,11 @@ A package can have multiple modules.
222
222
Your project directory should now look like this:
223
223
```
224
224
pyospackage/
225
-
└─ pyproject.toml
226
-
└─ src/
227
-
└── pyospackage/
228
-
├── __init__.py
229
-
├── add_numbers.py
230
-
225
+
└─ pyproject.toml
226
+
└─ src/
227
+
└── pyospackage/
228
+
├── __init__.py
229
+
├── add_numbers.py
231
230
```
232
231
233
232
## Step 3. Add code to your `add_numbers.py` module
0 commit comments