File: LP6E/Chapter36/badly.py

import traceback

def inverse(x):
    return 1 / x

try:
    inverse(0)
except Exception:
    traceback.print_exc(file=open('badly.txt', 'w'))
print('Bye')



[Home page] Books Code Blog Python Author Train Find ©M.Lutz