diff options
author | Skip Montanaro <skip@pobox.com> | 2006-04-23 19:30:50 (GMT) |
---|---|---|
committer | Skip Montanaro <skip@pobox.com> | 2006-04-23 19:30:50 (GMT) |
commit | 9ab2f453acc0da853c2623e0abb468f66c56a321 (patch) | |
tree | dcb871fca6157d9c5e8fd9be2572b314cb5725ef /Doc | |
parent | 56a3706fcde9b8f212d66c62a1654bcdd7065894 (diff) | |
download | cpython-9ab2f453acc0da853c2623e0abb468f66c56a321.zip cpython-9ab2f453acc0da853c2623e0abb468f66c56a321.tar.gz cpython-9ab2f453acc0da853c2623e0abb468f66c56a321.tar.bz2 |
it's always helpful if the example works...
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/lib/libtrace.tex | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Doc/lib/libtrace.tex b/Doc/lib/libtrace.tex index f13e8ae..65d1352 100644 --- a/Doc/lib/libtrace.tex +++ b/Doc/lib/libtrace.tex @@ -83,13 +83,15 @@ object with the current tracing parameters. \subsubsection{Example} \begin{verbatim} +import sys + # create a Trace object, telling it what to ignore, and whether to # do tracing or line-counting or both. -trace = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,], trace=0, +tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,], trace=0, count=1) -# run the new command using the given trace -trace.run('main()') -# make a report, telling it where you want output -r = trace.results() -r.write_results(show_missing=True) +# run the new command using the given tracer +tracer.run('main()') +# make a report, placing output in /tmp +r = tracer.results() +r.write_results(show_missing=True, coverdir="/tmp") \end{verbatim} |