From 95a590aabf0f6e73cdd5ae5e4dc6c996ca01b6ca Mon Sep 17 00:00:00 2001 From: mmcky Date: Thu, 3 Dec 2020 11:25:39 +1100 Subject: [PATCH] migrate code-block to literal with syntax highlighting --- lectures/debugging.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lectures/debugging.md b/lectures/debugging.md index 162d4720..c3822a34 100644 --- a/lectures/debugging.md +++ b/lectures/debugging.md @@ -121,13 +121,13 @@ plot_log() # Call the function, generate plot But this time we type in the following cell block -```{code-block} ipython +```ipython %debug ``` You should be dropped into a new prompt that looks something like this -```{code-block} ipython +```ipython ipdb> ``` @@ -138,7 +138,7 @@ Now we can investigate the value of our variables at this point in the program, For example, here we simply type the name `ax` to see what's happening with this object: -```{code-block} ipython +```ipython ipdb> ax array([, ], dtype=object) @@ -150,7 +150,7 @@ problem. To find out what else you can do from inside `ipdb` (or `pdb`), use the online help -```{code-block} ipython +```ipython ipdb> h Documented commands (type help ): @@ -203,7 +203,7 @@ To investigate, it would be helpful if we could inspect variables like `x` durin To this end, we add a "break point" by inserting `breakpoint()` inside the function code block -```{code-block} python3 +```python3 def plot_log(): breakpoint() fig, ax = plt.subplots() @@ -216,7 +216,7 @@ plot_log() Now let's run the script, and investigate via the debugger -```{code-block} ipython +```ipython > (6)plot_log() -> fig, ax = plt.subplots() (Pdb) n