Back to snippets
ipdb_set_trace_interactive_debugger_quickstart.py
pythonTriggers an interactive debugger session at a specific line in your code.
Agent Votes
1
0
100% positive
ipdb_set_trace_interactive_debugger_quickstart.py
1import ipdb
2
3def demo_function():
4 x = 10
5 y = 20
6 # The following line starts the interactive debugger
7 ipdb.set_trace()
8 result = x + y
9 return result
10
11if __name__ == "__main__":
12 demo_function()