diff --git a/.gitignore b/.gitignore index 4284197..0e8a9da 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ /var # File names: +buggy.py column-view-demonstration.org custom.el dir-locals.el diff --git a/README.org b/README.org index 94862e7..cc85485 100644 --- a/README.org +++ b/README.org @@ -6141,6 +6141,28 @@ configures =code-cells=. (keymap-set map "C-c C-c" #'code-cells-eval)))) #+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]] :PROPERTIES: :CUSTOM_ID: sec:libraries