Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4756bb3

Browse files
committed
Documentation for the py_compile module.
1 parent 64c105d commit 4756bb3

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

Doc/lib/libpycompile.tex

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
% Documentation based on module docstrings, by Fred L. Drake, Jr.
2+
3+
4+
\section{\module{py_compile} ---
5+
Compile Python source files.}
6+
7+
\declaremodule[pycompile]{standard}{py_compile}
8+
9+
\modulesynopsis{Compile Python source files to byte-code files.}
10+
11+
12+
\indexii{file}{byte-code}
13+
The \module{py_compile} module provides a single function to generate
14+
a byte-code file from a source file.
15+
16+
Though not often needed, this function can be useful when installing
17+
modules for shared use, especially if some of the users may not have
18+
permission to write the byte-code cache files in the directory
19+
containing the source code.
20+
21+
22+
\begin{funcdesc}{compile}{file\optional{, cfile\optional{, dfile}}}
23+
Compile a source file to byte-code and write out the byte-code cache
24+
file. The source code is loaded from the file name \var{file}. The
25+
byte-code is written to \var{cfile}, which defaults to \var{file}
26+
\code{+} \code{'c'} (\code{'o'} if optimization is enabled in the
27+
current interpreter). If \var{dfile} is specified, it is used as
28+
the name of the source file in error messages instead of \var{file}.
29+
\end{funcdesc}
30+
31+
32+
\begin{seealso}
33+
\seemodule{compileall}{Utilities to compile all Python source files
34+
in a directory tree.}
35+
\end{seealso}

0 commit comments

Comments
 (0)