summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2006-07-29 13:56:48 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2006-07-29 13:56:48 (GMT)
commit35f64c12d3d43c1d0022cab1fb9b9464edf1a13e (patch)
tree3932cc57e0479ab329beb8dd3f20becc898456c8
parent5391216050c52a800f3f25939e9d2a1747ede80f (diff)
downloadcpython-35f64c12d3d43c1d0022cab1fb9b9464edf1a13e.zip
cpython-35f64c12d3d43c1d0022cab1fb9b9464edf1a13e.tar.gz
cpython-35f64c12d3d43c1d0022cab1fb9b9464edf1a13e.tar.bz2
Add example
-rw-r--r--Doc/lib/libcompileall.tex13
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/lib/libcompileall.tex b/Doc/lib/libcompileall.tex
index d39a548..3e9667d 100644
--- a/Doc/lib/libcompileall.tex
+++ b/Doc/lib/libcompileall.tex
@@ -44,6 +44,19 @@ compile Python sources in directories named on the command line or in
\function{compile_dir()} function.
\end{funcdesc}
+To force a recompile of all the \file{.py} files in the \file{Lib/}
+subdirectory and all its subdirectories:
+
+\begin{verbatim}
+import compileall
+
+compileall.compile_dir('Lib/', force=True)
+
+# Perform same compilation, excluding files in .svn directories.
+import re
+compileall.compile_dir('Lib/', rx=re.compile('/[.]svn'), force=True)
+\end{verbatim}
+
\begin{seealso}
\seemodule[pycompile]{py_compile}{Byte-compile a single source file.}