profiling script :\codepython - profile showargs py - ['showargs py'' '' ''- ' function calls in seconds ordered bystandard name ncalls tottime percall cumtime more omittedsee profile docs percall filename:lineno(function : (charmap_encode : (execyou might also use the - switch to spawn ' idle gui program located in the standard library from any other directoryand to start the pydoc and timeit tools modules with command lines as we do in this book in and (see those for more details on the tools launched here) :\codepython - idlelib idle - run idle in packageno subprocess :\codepython - pydoc - run pydoc and timeit tools modules :\codepython - timeit - - - " [ , , , , ]" [ for in ]optimized and unbuffered modes immediately after the "pythonand before the designation of code to be runpython accepts additional arguments that control its own behavior these arguments are consumed by python itself and are not meant for the script being run for example- runs python in optimized mode and - forces standard streams to be unbuffered--with the latterany printed text will be finalized immediatelyand won' be delayed in bufferc:\codepython - showargs py - optimizedmake/run pyobyte code :\codepython - showargs py - unbuffered standard output stream post-run interactive mode finallythe - flag enters interactive mode after running script--especially useful as debugging toolbecause you can print variablesfinal values after successful run to get more detailsc:\codepython - showargs py - ['showargs py'' '' ''- 'sys ^ go to interactive mode on script exit final value of sysimported module you can also print variables this way after an exception shuts down your script to see what they looked like when the exception occurredeven if not running in debug mode --though you can start the debugger' postmortem tool here as well (type is the windows file display commandtry cat or other elsewhere) :\codetype divbad py appendix ainstallation and configuration