cgitb is a valuable debugging tool in the standard library. It was originally designed for showing errors and debugging information in web applications and was later updated to include plain-text output as well, but unfortunately was never renamed. This has led to obscurity, and the module is not used as often as it could be.
In [1]:
def func2(a, divisor):
return a/divisor
def func1(a, b):
c = b -5
return func2(a, c)
func1(1,5)
In [2]:
import cgitb
cgitb.enable(format='txt')
def func2(a, divisor):
return a/divisor
def func1(a, b):
c = b -5
return func2(a, c)
func1(1,5)
In [ ]: