Last active
January 7, 2023 00:48
-
-
Save geekscape/60d46ca470a8033d237607a68e528fac to your computer and use it in GitHub Desktop.
Python debugging example
This file contains 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 characters
#!/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