to profiling long-running programs debuggers we also discussed debugging options in (see its sidebar "debugging python codeon page as reviewmost development ides for python support gui-based debuggingand the python standard library also includes source code debugger module called pdb this module provides command-line interface and works much like common language debuggers ( dbxgdbmuch like the profilerthe pdb debugger can be run either interactively or from command line and can be imported and called from python program to use it interactivelyimport the modulestart running code by calling pdb function ( pdb run('main()'))and then type debugging commands from pdb' interactive prompt to launch pdb from system shell command lineuse command of the form python - pdb main py args pdb also includes useful postmortem analysis callpdb pm()which starts the debugger after an exception has been encounteredpossibly in conjunction with python' - flag see appendix for more on these tools because ides such as idle also include point-and-click debugging interfacespdb isn' as critical tool todayexcept when gui isn' available or when more control is desired see for tips on using idle' debugging gui interfaces reallyneither pdb nor ides seem to be used much in practice--as noted in most programmers either insert print statements or simply read python' error messagesperhaps not the most high-tech of approachesbut the practical tends to win the day in the python worldshipping options in we introduced common tools for packaging python programs py exepyinstallerand others listed in that can package byte code and the python virtual machine into "frozen binarystandalone executableswhich don' require that python be installed on the target machine and hide your system' code in additionwe learned in that python programs may be shipped in their source pyor byte code pycformsand that import hooks support special packaging techniques such as automatic extraction of zip files and byte code encryption we also briefly met the standard library' distutils moduleswhich provide packaging options for python modules and packagesand -coded extensionssee the python manuals for more details the emerging python "eggsthird-party packaging system provides another alternative that also accounts for dependenciessearch the web for more details optimization options when speed countsthere are handful of options for optimizing your programs the pypy system described in provides just-in-time compiler for translating python byte code to binary machine codeand shed skin offers python-tocore language summary