get exception line number python code example
Example: exception get line number python
import traceback
try:
print(4/0)
except ZeroDivisionError:
print(traceback.format_exc())
import traceback
try:
print(4/0)
except ZeroDivisionError:
print(traceback.format_exc())