Save Traceback html without printing the Traceback #3365
Unanswered
FuckingToasters
asked this question in
Q&A
Replies: 1 comment
-
Perhaps something like this where you write to a file rather than the terminal? import os
from rich.console import Console
with open(os.devnull, "w") as devnull:
console = Console(record=True, file=devnull)
try:
x = 1 / 0
except Exception:
console.print_exception()
console.save_html("traceback.html") |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, i was wondering if it is somehow possible to save the trceback html without outputting the traceback text.
I have an functuanily which when the normal .py file is ran, it print out as expected but after i compiled a executable and the executable is ran, it should save the html file, not print out anything, load the content from the html file, encrypt it, save encrypted content and delete the unencrypted html.
Sadly the html file seem to be empty when not printing out the error before saving it which breaks my whole idea.
I currently use following:
Beta Was this translation helpful? Give feedback.
All reactions