python exception error line number 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())