Python Forum
an exception traceback and continue
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
an exception traceback and continue
#3
You can invoke the functions from the traceback module to obtain this, for example
import traceback as tb

while True:
    n = input('Give me an integer: ')
    try:
        n = int(n)
    except ValueError:
        tb.print_exc()
    else:
        print('Got:', n)
Reply


Messages In This Thread
an exception traceback and continue - by Skaperen - Jan-17-2018, 03:47 AM
RE: an exception traceback and continue - by Gribouillis - Jan-17-2018, 07:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Star python exception handling handling .... with traceback mg24 3 1,323 Nov-09-2022, 07:29 PM
Last Post: Gribouillis
  During handling of the above exception, another exception occurred Skaperen 7 26,989 Dec-21-2018, 10:58 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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