@@ -121,13 +121,13 @@ plot_log() # Call the function, generate plot
|
121 | 121 | |
122 | 122 | But this time we type in the following cell block |
123 | 123 | |
124 | | -```{code-block} ipython |
| 124 | +```ipython |
125 | 125 | %debug |
126 | 126 | ``` |
127 | 127 | |
128 | 128 | You should be dropped into a new prompt that looks something like this |
129 | 129 | |
130 | | -```{code-block} ipython |
| 130 | +```ipython |
131 | 131 | ipdb> |
132 | 132 | ``` |
133 | 133 | |
@@ -138,7 +138,7 @@ Now we can investigate the value of our variables at this point in the program,
|
138 | 138 | For example, here we simply type the name `ax` to see what's happening with |
139 | 139 | this object: |
140 | 140 | |
141 | | -```{code-block} ipython |
| 141 | +```ipython |
142 | 142 | ipdb> ax |
143 | 143 | array([<matplotlib.axes.AxesSubplot object at 0x290f5d0>, |
144 | 144 | <matplotlib.axes.AxesSubplot object at 0x2930810>], dtype=object) |
@@ -150,7 +150,7 @@ problem.
|
150 | 150 | To find out what else you can do from inside `ipdb` (or `pdb`), use the |
151 | 151 | online help |
152 | 152 | |
153 | | -```{code-block} ipython |
| 153 | +```ipython |
154 | 154 | ipdb> h |
155 | 155 | |
156 | 156 | Documented commands (type help <topic>): |
@@ -203,7 +203,7 @@ To investigate, it would be helpful if we could inspect variables like `x` durin
|
203 | 203 | |
204 | 204 | To this end, we add a "break point" by inserting `breakpoint()` inside the function code block |
205 | 205 | |
206 | | -```{code-block} python3 |
| 206 | +```python3 |
207 | 207 | def plot_log(): |
208 | 208 | breakpoint() |
209 | 209 | fig, ax = plt.subplots() |
@@ -216,7 +216,7 @@ plot_log()
|
216 | 216 | |
217 | 217 | Now let's run the script, and investigate via the debugger |
218 | 218 | |
219 | | -```{code-block} ipython |
| 219 | +```ipython |
220 | 220 | > <ipython-input-6-a188074383b7>(6)plot_log() |
221 | 221 | -> fig, ax = plt.subplots() |
222 | 222 | (Pdb) n |
|