-
-
Save rahulrajaram/9566e051a76c5c9b1612acf3e5117e22 to your computer and use it in GitHub Desktop.
Save stack trace to file
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
import traceback | |
def print_stack_trace(): | |
try: | |
raise Exception | |
except Exception: | |
with open('~/.my_important_stack_trace', 'w') as file: | |
file.write('{}'.format(repr(traceback.format_stack()))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment