Python On Exit Function Process