[code.view]

[top] / python / PyMOTW / traceback / traceback_print_stack.py

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2008 Doug Hellmann All rights reserved.
     #
     """
     """
     #end_pymotw_header
     
     import traceback
     import sys
     
     from traceback_example import call_function
     
     def f():
         traceback.print_stack(file=sys.stdout)
     
     print 'Calling f() directly:'
     f()
     
     print
     print 'Calling f() from 3 levels deep:'
     call_function(f)
     

[top] / python / PyMOTW / traceback / traceback_print_stack.py

contact | logmethods.com