Answers for "python how to get line number of exception"

2

exception get line number python

import traceback

try:
    print(4/0)
except ZeroDivisionError:
    print(traceback.format_exc())
Posted by: Guest on January-28-2021
1

python get line of exception

except Exception as e:
Posted by: Guest on December-26-2020

Code answers related to "python how to get line number of exception"

Python Answers by Framework

Browse Popular Code Answers by Language