Python Forum
how to get a traceback and keep on running?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to get a traceback and keep on running?
#1
how to get a traceback and keep on running? i'd like to know because it can sometimes be useful. plus, it happened on its own with code i was working on, today. i forgot to save that output and where it happened would be nice to find. it has happened a couple times in the past, so i know something can do it.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
import traceback

items = {}

try:
    items["NoKey"]
except KeyError:
    format_exc = traceback.format_exc()

print("Keep running")
print(format_exc)
Skaperen likes this post
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020