From: Andrew M. Kuchling <amk@amk.ca> Date: Sat, 29 Jul 2006 13:56:48 +0000 (+0000) Subject: Add example X-Git-Tag: v2.5b3~92 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35f64c12d3d43c1d0022cab1fb9b9464edf1a13e;p=python Add example --- diff --git a/Doc/lib/libcompileall.tex b/Doc/lib/libcompileall.tex index d39a5481f1..3e9667d9e5 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.}