python try except print error line 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())