[Python-checkins] r50927 - python/trunk/Doc/lib/libcompileall.tex
andrew.kuchling
python-checkins at python.org
Sat Jul 29 15:56:48 CEST 2006
Author: andrew.kuchling
Date: Sat Jul 29 15:56:48 2006
New Revision: 50927
Modified:
python/trunk/Doc/lib/libcompileall.tex
Log:
Add example
Modified: python/trunk/Doc/lib/libcompileall.tex
==============================================================================
--- python/trunk/Doc/lib/libcompileall.tex (original)
+++ python/trunk/Doc/lib/libcompileall.tex Sat Jul 29 15:56:48 2006
@@ -44,6 +44,19 @@
\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.}
More information about the Python-checkins
mailing list