Last active
May 20, 2022 07:34
-
-
Save cmower/95e60c8602facef6f6568917db73e94a to your computer and use it in GitHub Desktop.
Python debugging
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 characters
class Debugger: | |
"""Simple class for debugging""" | |
def __init__(self): | |
self.it = 0 | |
def __call__(self, msg=''): | |
print('-'*40, f'DEBUG {self.it} {msg}', end=(' ' if msg else '') +'-'*40) | |
self.it += 1 | |
def example(): | |
debug = Debugger() | |
debug('start code here') | |
# | |
# Write some potetially buggy code! | |
# | |
debug('end code here') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment