From 35f64c12d3d43c1d0022cab1fb9b9464edf1a13e Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Sat, 29 Jul 2006 13:56:48 +0000 Subject: [PATCH] Add example --- Doc/lib/libcompileall.tex | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Doc/lib/libcompileall.tex b/Doc/lib/libcompileall.tex index d39a5481f14..3e9667d9e55 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.}