¡@

Home 

python Programming Glossary: last_frame

Starting python debugger automatically on error

http://stackoverflow.com/questions/242485/starting-python-debugger-automatically-on-error

except type value tb sys.exc_info traceback.print_exc last_frame lambda tb tb last_frame tb.tb_next if tb.tb_next else tb frame.. sys.exc_info traceback.print_exc last_frame lambda tb tb last_frame tb.tb_next if tb.tb_next else tb frame last_frame .tb_frame.. tb tb last_frame tb.tb_next if tb.tb_next else tb frame last_frame .tb_frame ns dict frame.f_globals ns.update frame.f_locals code.interact..

know filename:line_no where an import to my_module was made

http://stackoverflow.com/questions/5603321/know-filenameline-no-where-an-import-to-my-module-was-made

Place this in your top level module code import traceback last_frame traceback.extract_stack 2 print 'Module imported from file line_no.. 2 print 'Module imported from file line_no s i' last_frame 2 You can also use inspect instead of traceback import inspect.. can also use inspect instead of traceback import inspect last_frame inspect.stack 1 print 'Module imported from file line_no s i'..