Last active
January 27, 2020 14:00
-
-
Save jorgeas80/65bc92e689fe05ddce24438e0c5853dc to your computer and use it in GitHub Desktop.
Revisions
-
jorgeas80 revised this gist
Jan 27, 2020 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,9 +7,12 @@ Breakpoint 1 at /home/user/path/to/another/module/another_module.py:356 (Pdb) c # Conditionally hit the breakpoint #1 (Pdb) conditions 1 some_variable == some_value # Watch a variable when you are hitting breakpoint #1. And ensure the breakpoint is only hit whenever the variable takes a certain value. # Ref: https://stackoverflow.com/a/34620310/593722 (Pdb) commands 1 (com) print(some_variable) (com) end -
jorgeas80 revised this gist
Jan 27, 2020 . 1 changed file with 8 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,15 @@ # Put a breakpoint in a file that is not part of our code # Ref: https://stackoverflow.com/q/13589736/593722 (Pdb) import sys (Pdb) sys.path.append("/home/user/path/to/another/module") (Pdb) import another_module (Pdb) b another_module:356 Breakpoint 1 at /home/user/path/to/another/module/another_module.py:356 (Pdb) c # Watch a variable when you are hitting breakpoint #1. And ensure the breakpoint is only hit whenever the variable takes a certain value. # Ref: https://stackoverflow.com/a/34620310/593722 (Pdb) commands 1 (com) print(some_variable) (com) end (Pdb) conditions 1 some_variable == some_value -
jorgeas80 revised this gist
Jan 27, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ # Watch a variable when you are hitting breakpoint #1 # Ref: https://stackoverflow.com/a/34620310/593722 (Pdb) commands 1 (com) print(some_variable) (com) end -
jorgeas80 created this gist
Jan 27, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ # Watch a variable when you are hitting breakpoint #1 # Ref: https://docs.python.org/2/library/pdb.html#debugger-commands (Pdb) commands 1 (com) print(some_variable) (com) end (Pdb) # Put a breakpoint in a file that is not part of our code # Ref: https://stackoverflow.com/q/13589736/593722 (Pdb) import sys (Pdb) sys.path.append("/home/user/path/to/another/module") (Pdb) import another_module (Pdb) b another_module:356 Breakpoint 1 at /home/user/path/to/another/module/another_module.py:356 (Pdb) c