]> granicus.if.org Git - python/commitdiff
Add example
authorAndrew M. Kuchling <amk@amk.ca>
Sat, 29 Jul 2006 13:56:48 +0000 (13:56 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Sat, 29 Jul 2006 13:56:48 +0000 (13:56 +0000)
Doc/lib/libcompileall.tex

index d39a5481f1486fb10fc2718b44648abead3ad4c3..3e9667d9e5521b1b3cc8dbbb2d635265846064f7 100644 (file)
@@ -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.}