Skip to content

Instantly share code, notes, and snippets.

@geekscape
Last active January 7, 2023 00:48
Show Gist options
  • Save geekscape/60d46ca470a8033d237607a68e528fac to your computer and use it in GitHub Desktop.
Save geekscape/60d46ca470a8033d237607a68e528fac to your computer and use it in GitHub Desktop.
Python debugging example
#!/usr/bin/env python3
def a(a1, a2):
a1 = a1 - 1
# breakpoint()
result = b(a1, a2)
return result
def b(b1, b2):
b2 = b2 - 1
# breakpoint()
raise Exception("Deliberate exception raised !")
result = c(b1, b2)
return result
def c(c1, c2):
# breakpoint()
result = c1 / c2
return result
def main():
a(2, 2)
a(2, 1)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment