works_fine(--- throws_an_exception( calling_things(/home/wesm/book_scripts/ch /ipython_bug py in throws_an_exception( ---- assert( = def calling_things()assertionerrorin [ ]%debug /home/wesm/book_scripts/ch /ipython_bug py( )throws_an_exception( ---- assert( = ipdbonce inside the debuggeryou can execute arbitrary python code and explore all of the objects and data (which have been "kept aliveby the interpreterinside each stack frame by default you start in the lowest levelwhere the error occurred by pressing (upand (down)you can switch between the levels of the stack traceipdbu /home/wesm/book_scripts/ch /ipython_bug py( )calling_things( works_fine(--- throws_an_exception( executing the %pdb command makes it so that ipython automatically invokes the debugger after any exceptiona mode that many users will find especially useful it' also easy to use the debugger to help develop codeespecially when you wish to set breakpoints or step through the execution of function or script to examine the state at each stage there are several ways to accomplish this the first is by using %run with the - flagwhich invokes the debugger before executing any code in the passed script you must immediately press (stepto enter the scriptin [ ]run - ch /ipython_bug py breakpoint at /home/wesm/book_scripts/ch /ipython_bug py: noteenter 'cat the ipdbprompt to start your script ( )(ipdbs --call-/home/wesm/book_scripts/ch /ipython_bug py( )( --- def works_fine() software development tools www it-ebooks info