type help to get the list of commandsand help followed by command name for more information on the command for examplehelp stats will list what arguments can be given to the stats command other tools are available that can provide graphical visualization of the profile datafor examplerunsnakerun (www vrplumber com/programming/runsnakerun)which depends on the wxpython gui library using the timeit and cprofile modules we can identify areas of our code that might be taking more time than expectedand using the cprofile modulewe can find out exactly where the time is being taken summary ||in generalpython' reporting of syntax errors is very accuratewith the line and position in the line being correctly identified the only cases where this doesn' work well are when we forget closing parenthesisbracketor bracein which case the error is normally reported as being on the next nonblank line fortunatelysyntax errors are almost always easy to see and to fix if an unhandled exception is raisedpython will terminate and output traceback such tracebacks can be intimidating for end-usersbut provide useful information to us as programmers ideallywe should always handle every type of exception that we believe our program can raiseand where necessary present the problem to the user in the form of an error messagemessage boxor log message--but not as raw traceback howeverwe should avoid using the catchall exceptexception handler--if we want to handle all exceptions ( at the top level)then we can use except exception as errand always report errsince silently handling exceptions can lead to programs failing in subtle and unnoticed ways (such as corrupting datalater on and during developmentit is probably best not to have top-level exception handler at all and to simply have the program crash with traceback debugging need not be--and should not be-- hit and miss affair by narrowing down the input necessary to reproduce the bug to the bare minimumby carefully hypothesizing what the problem isand then testing the hypothesis by experiment--using print(statements or debugger--we can often locate the source of the bug quite quickly and if our hypothesis has successfully led us to the bugit is likely to also be helpful in devising solution for testingboth the doctest and the unittest modules have their own particular virtues doctests tend to be particularly convenient and useful for small libraries and modules since well-chosen tests can easily both illustrate and exercise boundary as well as common casesand of coursewriting doctests is convenient and easy on the other handsince unit tests are not constrained to be written inside docstrings and are written as separate stand-alone modulesthey are usually better choice when it comes to writing more complex and