Add Python debugging section
This commit is contained in:
parent
410884952e
commit
034b9d68ee
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,6 +11,7 @@
|
|||||||
/var
|
/var
|
||||||
|
|
||||||
# File names:
|
# File names:
|
||||||
|
buggy.py
|
||||||
column-view-demonstration.org
|
column-view-demonstration.org
|
||||||
custom.el
|
custom.el
|
||||||
dir-locals.el
|
dir-locals.el
|
||||||
|
22
README.org
22
README.org
@ -6141,6 +6141,28 @@ configures =code-cells=.
|
|||||||
(keymap-set map "C-c C-c" #'code-cells-eval))))
|
(keymap-set map "C-c C-c" #'code-cells-eval))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
*** [[https://stackoverflow.com/questions/2324758/debugging-python-programs-in-emacs][Debugging Python programs in Emacs]]
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: sec:debug-python
|
||||||
|
:END:
|
||||||
|
|
||||||
|
Listing [[lst:pdb-example]] shows how to start using PDB. Links of interest are:
|
||||||
|
- [[https://realpython.com/python-debugging-pdb/][Python Debugging with PDB]]
|
||||||
|
- [[https://docs.python.org/3/library/pdb.html][The Python Debugger]]
|
||||||
|
- [[yt:vfPtGsSJldg][Introduction to PDB (Python-2.7 YouTube video)]]
|
||||||
|
|
||||||
|
#+caption[PDB example: =python -m pdb .emacs.d/buggy.py=]:
|
||||||
|
#+caption: PDB example: =python -m pdb .emacs.d/buggy.py=.
|
||||||
|
#+name: lst:pdb-example
|
||||||
|
#+begin_src python -i -n :results silent :tangle buggy.py
|
||||||
|
def unsafe(x, y):
|
||||||
|
"""Raises an exception if the second argument equals zero."""
|
||||||
|
return x / y
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unsafe(1.0, 0.0)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
* [[https://github.com/emacs-tw/awesome-emacs#library][Libraries]]
|
* [[https://github.com/emacs-tw/awesome-emacs#library][Libraries]]
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: sec:libraries
|
:CUSTOM_ID: sec:libraries
|
||||||
|
Loading…
Reference in New Issue
Block a user