Skip to content

Instantly share code, notes, and snippets.

@nachmore
Last active July 16, 2023 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nachmore/115505f5f9bc39e295ed25beceeeb7bd to your computer and use it in GitHub Desktop.
Save nachmore/115505f5f9bc39e295ed25beceeeb7bd to your computer and use it in GitHub Desktop.
Create an interactive Python shell at a specific line
import pdb
pdb.set_trace
# b: set a breakpoint
# c: continue debugging until you hit a breakpoint
# s: step through the code
# n: to go to next line of code
# l: list source code for the current file (default: 11 lines including the line being executed)
# u: navigate up a stack frame
# d: navigate down a stack frame
# p: to print the value of an expression in the current context
# p dir(obj): dump all attributes of an object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment