Guest User

Untitled

a guest
Aug 16th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. ipython debugger: full traceback on interactive pdb?
  2. In [1]: pdb
  3. Automatic pdb calling has been turned ON
  4.  
  5. In [2]: 1/0
  6. > <ipython-input-2-05c9758a9c21>(1)<module>()
  7. -1 1/0
  8.  
  9. ipdb> q
  10. ---------------------------------------------------------------------------
  11. ZeroDivisionError Traceback (most recent call last)
  12. /Users/adam/<ipython-input-2-05c9758a9c21> in <module>()
  13. ----> 1 1/0
  14.  
  15. ZeroDivisionError: integer division or modulo by zero
  16.  
  17. import sys
  18.  
  19. def exc_hook(type, value, traceback):
  20. print type
  21.  
  22. sys.excepthook = exc_hook
  23.  
  24. $ ipython [options] files
  25.  
  26. --xmode=<modename>
  27.  
  28. [ 19:55 jon@hozbox ~/SO/python ]$ ipython --xmode=Plain ipython-debugger-full-traceback-on-interactive-pdb.py
  29. ------------------------------------------------------------
  30. Traceback (most recent call last):
  31. File "ipython-debugger-full-traceback-on-interactive-pdb.py", line 2, in <module>
  32. 1 / 0
  33. ZeroDivisionError: integer division or modulo by zero
  34.  
  35. [ 19:55 jon@hozbox ~/SO/python ]$ ipython --xmode=Context ipython-debugger-full-traceback-on-interactive-pdb.py
  36. ---------------------------------------------------------------------------
  37. ZeroDivisionError Traceback (most recent call last)
  38.  
  39. /home/jon/SO/python/ipython-debugger-full-traceback-on-interactive-pdb.py in <module>()
  40. 1
  41. ----> 2 #!/usr/bin/python
  42. 3 1 / 0
  43. 4
  44. 5
  45.  
  46. ZeroDivisionError: integer division or modulo by zero
  47.  
  48. [ 19:54 jon@hozbox ~/SO/python ]$ ipython --xmode=Verbose ipython-debugger-full-traceback-on-interactive-pdb.py
  49. ---------------------------------------------------------------------------
  50. ZeroDivisionError Traceback (most recent call last)
  51.  
  52. /home/jon/SO/python/ipython-debugger-full-traceback-on-interactive-pdb.py in <module>()
  53. 1
  54. ----> 2 #!/usr/bin/python
  55. 3 1 / 0
  56. 4
  57. 5
  58.  
  59. ZeroDivisionError: integer division or modulo by zero
  60.  
  61. [ 19:55 jon@hozbox ~/SO/python ]$ ipython --xmode=Plain
  62.  
  63. In [1]: 1 / 0
  64. ------------------------------------------------------------
  65. Traceback (most recent call last):
  66. File "<ipython console>", line 1, in <module>
  67. ZeroDivisionError: integer division or modulo by zero
  68.  
  69. [ 20:03 jon@hozbox ~/SO/python ]$ ipython --xmode=Context
  70.  
  71. In [1]: 1 / 0
  72. ---------------------------------------------------------------------------
  73. ZeroDivisionError Traceback (most recent call last)
  74.  
  75. /home/jon/SO/python/<ipython console> in <module>()
  76.  
  77. ZeroDivisionError: integer division or modulo by zero
  78.  
  79. [ 20:01 jon@hozbox ~/SO/python ]$ ipython --xmode=Verbose
  80.  
  81.  
  82. In [1]: 1 / 0
  83. ---------------------------------------------------------------------------
  84. ZeroDivisionError Traceback (most recent call last)
  85.  
  86. /home/jon/SO/python/<ipython console> in <module>()
  87.  
  88. ZeroDivisionError: integer division or modulo by zero
Add Comment
Please, Sign In to add comment