annotate Doc/lib/libpycompile.tex @ 21467:4e35fa5d5708 legacy-trunk

Add documentation for the help() built-in; contributed by Ka-Ping Yee. This is part of SF patch #494622.
author Fred Drake <fdrake@acm.org>
date Tue, 18 Dec 2001 16:31:08 +0000
parents e82e82b3b9ad
children e9500709d49c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12223
e82e82b3b9ad Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 8936
diff changeset
1 \section{\module{py_compile} ---
e82e82b3b9ad Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 8936
diff changeset
2 Compile Python source files}
e82e82b3b9ad Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 8936
diff changeset
3
8936
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
4 % Documentation based on module docstrings, by Fred L. Drake, Jr.
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
5 % <fdrake@acm.org>
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
6
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
7 \declaremodule[pycompile]{standard}{py_compile}
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
8
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
9 \modulesynopsis{Compile Python source files to byte-code files.}
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
10
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
11
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
12 \indexii{file}{byte-code}
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
13 The \module{py_compile} module provides a single function to generate
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
14 a byte-code file from a source file.
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
15
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
16 Though not often needed, this function can be useful when installing
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
17 modules for shared use, especially if some of the users may not have
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
18 permission to write the byte-code cache files in the directory
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
19 containing the source code.
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
20
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
21
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
22 \begin{funcdesc}{compile}{file\optional{, cfile\optional{, dfile}}}
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
23 Compile a source file to byte-code and write out the byte-code cache
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
24 file. The source code is loaded from the file name \var{file}. The
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
25 byte-code is written to \var{cfile}, which defaults to \var{file}
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
26 \code{+} \code{'c'} (\code{'o'} if optimization is enabled in the
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
27 current interpreter). If \var{dfile} is specified, it is used as
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
28 the name of the source file in error messages instead of \var{file}.
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
29 \end{funcdesc}
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
30
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
31
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
32 \begin{seealso}
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
33 \seemodule{compileall}{Utilities to compile all Python source files
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
34 in a directory tree.}
5b73d5babc78 Documentation for the py_compile module.
Fred Drake <fdrake@acm.org>
parents:
diff changeset
35 \end{seealso}