Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/libsys.tex @ 17322:bd110eadc19a legacy-trunk
One-liner critical fix from Jim Fulton: Eric's string-method crusade
got the order backwards in a line (for .find()).
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Thu, 05 Apr 2001 22:26:23 +0000 |
| parents | 596efa7e7df8 |
| children | 35e3f2418b2d 064de84385ca |
| rev | line source |
|---|---|
| 8918 | 1 \section{\module{sys} --- |
|
10703
e4e800a78d8d
Make internal module references hyperlinks wherever it makes sense.
Fred Drake <fdrake@acm.org>
parents:
10465
diff
changeset
|
2 System-specific parameters and functions} |
|
e4e800a78d8d
Make internal module references hyperlinks wherever it makes sense.
Fred Drake <fdrake@acm.org>
parents:
10465
diff
changeset
|
3 |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8480
diff
changeset
|
4 \declaremodule{builtin}{sys} |
| 8918 | 5 \modulesynopsis{Access system-specific parameters and functions.} |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8480
diff
changeset
|
6 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
7 This module provides access to some variables used or maintained by the |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
8 interpreter and to functions that interact strongly with the interpreter. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
9 It is always available. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
10 |
|
2576
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2491
diff
changeset
|
11 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
12 \begin{datadesc}{argv} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
13 The list of command line arguments passed to a Python script. |
| 7602 | 14 \code{argv[0]} is the script name (it is operating system |
|
2576
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2491
diff
changeset
|
15 dependent whether this is a full pathname or not). |
|
11457
ef03f16ae5eb
Use the new markup as apporpriate.
Fred Drake <fdrake@acm.org>
parents:
10703
diff
changeset
|
16 If the command was executed using the \programopt{-c} command line |
|
ef03f16ae5eb
Use the new markup as apporpriate.
Fred Drake <fdrake@acm.org>
parents:
10703
diff
changeset
|
17 option to the interpreter, \code{argv[0]} is set to the string |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8480
diff
changeset
|
18 \code{'-c'}. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
19 If no script name was passed to the Python interpreter, |
| 7602 | 20 \code{argv} has zero length. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
21 \end{datadesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
22 |
|
13977
eb9a36163a9e
Guido pointed out that all names in the sys module have no underscore,
Fred Drake <fdrake@acm.org>
parents:
13969
diff
changeset
|
23 \begin{datadesc}{byteorder} |
|
13969
55e3988205b3
Document the byte_order value in the sys module.
Fred Drake <fdrake@acm.org>
parents:
13222
diff
changeset
|
24 An indicator of the native byte order. This will have the value |
|
55e3988205b3
Document the byte_order value in the sys module.
Fred Drake <fdrake@acm.org>
parents:
13222
diff
changeset
|
25 \code{'big'} on big-endian (most-signigicant byte first) platforms, |
|
55e3988205b3
Document the byte_order value in the sys module.
Fred Drake <fdrake@acm.org>
parents:
13222
diff
changeset
|
26 and \code{'little'} on little-endian (least-significant byte first) |
|
55e3988205b3
Document the byte_order value in the sys module.
Fred Drake <fdrake@acm.org>
parents:
13222
diff
changeset
|
27 platforms. |
|
55e3988205b3
Document the byte_order value in the sys module.
Fred Drake <fdrake@acm.org>
parents:
13222
diff
changeset
|
28 \versionadded{2.0} |
|
55e3988205b3
Document the byte_order value in the sys module.
Fred Drake <fdrake@acm.org>
parents:
13222
diff
changeset
|
29 \end{datadesc} |
|
55e3988205b3
Document the byte_order value in the sys module.
Fred Drake <fdrake@acm.org>
parents:
13222
diff
changeset
|
30 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
31 \begin{datadesc}{builtin_module_names} |
|
4908
cfa1282902da
Document that sys.builtin_module_names is now a tuple.
Guido van Rossum <guido@python.org>
parents:
2817
diff
changeset
|
32 A tuple of strings giving the names of all modules that are compiled |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
33 into this Python interpreter. (This information is not available in |
| 7602 | 34 any other way --- \code{modules.keys()} only lists the imported |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
35 modules.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
36 \end{datadesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
37 |
|
8480
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
38 \begin{datadesc}{copyright} |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
39 A string containing the copyright pertaining to the Python interpreter. |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
40 \end{datadesc} |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
41 |
|
12223
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
42 \begin{datadesc}{dllhandle} |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
43 Integer specifying the handle of the Python DLL. |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
44 Availability: Windows. |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
45 \end{datadesc} |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
46 |
|
15811
1a00d21910c8
Implementation of PEP-0217.
Moshe Zadka <moshez@math.huji.ac.il>
parents:
15487
diff
changeset
|
47 \begin{funcdesc}{displayhook}{\var{value}} |
|
1a00d21910c8
Implementation of PEP-0217.
Moshe Zadka <moshez@math.huji.ac.il>
parents:
15487
diff
changeset
|
48 If \var{value} is not \code{None}, this function prints it to |
|
1a00d21910c8
Implementation of PEP-0217.
Moshe Zadka <moshez@math.huji.ac.il>
parents:
15487
diff
changeset
|
49 \code{sys.stdout}, and saves it in \code{__builtin__._}. |
|
1a00d21910c8
Implementation of PEP-0217.
Moshe Zadka <moshez@math.huji.ac.il>
parents:
15487
diff
changeset
|
50 |
| 17164 | 51 \code{sys.displayhook} is called on the result of evaluating |
| 52 an expression entered in an interactive Python session. | |
| 53 The display of these values can be customized by assigning | |
|
17176
596efa7e7df8
Give a slightly better explanation of excepthook.
Ka-Ping Yee <ping@zesty.ca>
parents:
17164
diff
changeset
|
54 another one-argument function to \code{sys.displayhook}. |
|
15811
1a00d21910c8
Implementation of PEP-0217.
Moshe Zadka <moshez@math.huji.ac.il>
parents:
15487
diff
changeset
|
55 \end{funcdesc} |
|
1a00d21910c8
Implementation of PEP-0217.
Moshe Zadka <moshez@math.huji.ac.il>
parents:
15487
diff
changeset
|
56 |
| 17164 | 57 \begin{funcdesc}{excepthook}{\var{type}, \var{value}, \var{traceback}} |
| 58 This function prints out a given traceback and exception to | |
| 59 \code{sys.stderr}. | |
| 60 | |
|
17176
596efa7e7df8
Give a slightly better explanation of excepthook.
Ka-Ping Yee <ping@zesty.ca>
parents:
17164
diff
changeset
|
61 When an exception is raised and uncaught, the interpreter calls |
|
596efa7e7df8
Give a slightly better explanation of excepthook.
Ka-Ping Yee <ping@zesty.ca>
parents:
17164
diff
changeset
|
62 \code{sys.excepthook} with three arguments, the exception class, |
|
596efa7e7df8
Give a slightly better explanation of excepthook.
Ka-Ping Yee <ping@zesty.ca>
parents:
17164
diff
changeset
|
63 exception instance, and a traceback object. |
|
596efa7e7df8
Give a slightly better explanation of excepthook.
Ka-Ping Yee <ping@zesty.ca>
parents:
17164
diff
changeset
|
64 In an interactive session this happens just before |
| 17164 | 65 control is returned to the prompt; in a Python program this happens |
| 66 just before the program exits. | |
| 67 The handling of such top-level exceptions can be customized by | |
|
17176
596efa7e7df8
Give a slightly better explanation of excepthook.
Ka-Ping Yee <ping@zesty.ca>
parents:
17164
diff
changeset
|
68 assigning another three-argument function to \code{sys.excepthook}. |
| 17164 | 69 \end{funcdesc} |
| 70 | |
| 71 \begin{datadesc}{__displayhook__} | |
| 72 \dataline{__excepthook__} | |
| 73 These objects contain the original values of \code{displayhook} | |
| 74 and \code{excepthook} at the start of the program. They are saved | |
| 75 so that \code{displayhook} and \code{excepthook} can be restored | |
| 76 in case they happen to get replaced with broken objects. | |
| 77 \end{datadesc} | |
| 78 | |
|
6492
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
79 \begin{funcdesc}{exc_info}{} |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
80 This function returns a tuple of three values that give information |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
81 about the exception that is currently being handled. The information |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
82 returned is specific both to the current thread and to the current |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
83 stack frame. If the current stack frame is not handling an exception, |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
84 the information is taken from the calling stack frame, or its caller, |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
85 and so on until a stack frame is found that is handling an exception. |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
86 Here, ``handling an exception'' is defined as ``executing or having |
| 7602 | 87 executed an except clause.'' For any stack frame, only |
|
6492
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
88 information about the most recently handled exception is accessible. |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
89 |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
90 If no exception is being handled anywhere on the stack, a tuple |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
91 containing three \code{None} values is returned. Otherwise, the |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
92 values returned are |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
93 \code{(\var{type}, \var{value}, \var{traceback})}. |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
94 Their meaning is: \var{type} gets the exception type of the exception |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
95 being handled (a string or class object); \var{value} gets the |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
96 exception parameter (its \dfn{associated value} or the second argument |
| 7602 | 97 to \keyword{raise}, which is always a class instance if the exception |
|
6492
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
98 type is a class object); \var{traceback} gets a traceback object (see |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
99 the Reference Manual) which encapsulates the call stack at the point |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
100 where the exception originally occurred. |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
101 \obindex{traceback} |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
102 |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
103 \strong{Warning:} assigning the \var{traceback} return value to a |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
104 local variable in a function that is handling an exception will cause |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
105 a circular reference. This will prevent anything referenced by a local |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
106 variable in the same function or by the traceback from being garbage |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
107 collected. Since most functions don't need access to the traceback, |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
108 the best solution is to use something like |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
109 \code{type, value = sys.exc_info()[:2]} |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
110 to extract only the exception type and value. If you do need the |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
111 traceback, make sure to delete it after use (best done with a |
| 7602 | 112 \keyword{try} ... \keyword{finally} statement) or to call |
| 113 \function{exc_info()} in a function that does not itself handle an | |
| 114 exception. | |
|
6492
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
115 \end{funcdesc} |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
116 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
117 \begin{datadesc}{exc_type} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
118 \dataline{exc_value} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
119 \dataline{exc_traceback} |
| 7602 | 120 \deprecated {1.5} |
| 121 {Use \function{exc_info()} instead.} | |
| 122 Since they are global variables, they are not specific to the current | |
|
6492
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
123 thread, so their use is not safe in a multi-threaded program. When no |
| 7602 | 124 exception is being handled, \code{exc_type} is set to \code{None} and |
| 125 the other two are undefined. | |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
126 \end{datadesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
127 |
|
5684
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
128 \begin{datadesc}{exec_prefix} |
|
11457
ef03f16ae5eb
Use the new markup as apporpriate.
Fred Drake <fdrake@acm.org>
parents:
10703
diff
changeset
|
129 A string giving the site-specific directory prefix where the |
|
ef03f16ae5eb
Use the new markup as apporpriate.
Fred Drake <fdrake@acm.org>
parents:
10703
diff
changeset
|
130 platform-dependent Python files are installed; by default, this is |
|
ef03f16ae5eb
Use the new markup as apporpriate.
Fred Drake <fdrake@acm.org>
parents:
10703
diff
changeset
|
131 also \code{'/usr/local'}. This can be set at build time with the |
|
12380
37d9ded5ab91
Make use of \longprogramopt where appropriate.
Fred Drake <fdrake@acm.org>
parents:
12223
diff
changeset
|
132 \longprogramopt{exec-prefix} argument to the |
| 7602 | 133 \program{configure} script. Specifically, all configuration files |
| 134 (e.g. the \file{config.h} header file) are installed in the directory | |
|
11457
ef03f16ae5eb
Use the new markup as apporpriate.
Fred Drake <fdrake@acm.org>
parents:
10703
diff
changeset
|
135 \code{exec_prefix + '/lib/python\var{version}/config'}, and shared |
|
ef03f16ae5eb
Use the new markup as apporpriate.
Fred Drake <fdrake@acm.org>
parents:
10703
diff
changeset
|
136 library modules are installed in \code{exec_prefix + |
|
ef03f16ae5eb
Use the new markup as apporpriate.
Fred Drake <fdrake@acm.org>
parents:
10703
diff
changeset
|
137 '/lib/python\var{version}/lib-dynload'}, where \var{version} is equal |
|
ef03f16ae5eb
Use the new markup as apporpriate.
Fred Drake <fdrake@acm.org>
parents:
10703
diff
changeset
|
138 to \code{version[:3]}. |
|
5684
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
139 \end{datadesc} |
|
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
140 |
|
8480
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
141 \begin{datadesc}{executable} |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
142 A string giving the name of the executable binary for the Python |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
143 interpreter, on systems where this makes sense. |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
144 \end{datadesc} |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
145 |
|
9511
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
146 \begin{funcdesc}{exit}{\optional{arg}} |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
147 Exit from Python. This is implemented by raising the |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
148 \exception{SystemExit} exception, so cleanup actions specified by |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
149 finally clauses of \keyword{try} statements are honored, and it is |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
150 possible to intercept the exit attempt at an outer level. The |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
151 optional argument \var{arg} can be an integer giving the exit status |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
152 (defaulting to zero), or another type of object. If it is an integer, |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
153 zero is considered ``successful termination'' and any nonzero value is |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
154 considered ``abnormal termination'' by shells and the like. Most |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
155 systems require it to be in the range 0-127, and produce undefined |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
156 results otherwise. Some systems have a convention for assigning |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
157 specific meanings to specific exit codes, but these are generally |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
158 underdeveloped; Unix programs generally use 2 for command line syntax |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
159 errors and 1 for all other kind of errors. If another type of object |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
160 is passed, \code{None} is equivalent to passing zero, and any other |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
161 object is printed to \code{sys.stderr} and results in an exit code of |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
162 1. In particular, \code{sys.exit("some error message")} is a quick |
|
bbe92932a005
Rewrote the section on sys.exit(), documenting other argument types
Guido van Rossum <guido@python.org>
parents:
8918
diff
changeset
|
163 way to exit a program when an error occurs. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
164 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
165 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
166 \begin{datadesc}{exitfunc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
167 This value is not actually defined by the module, but can be set by |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
168 the user (or by a program) to specify a clean-up action at program |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
169 exit. When set, it should be a parameterless function. This function |
|
13051
f13384105528
Added the atexit module and documentation from Skip Montanaro
Fred Drake <fdrake@acm.org>
parents:
12397
diff
changeset
|
170 will be called when the interpreter exits. Only one function may be |
|
f13384105528
Added the atexit module and documentation from Skip Montanaro
Fred Drake <fdrake@acm.org>
parents:
12397
diff
changeset
|
171 installed in this way; to allow multiple functions which will be called |
|
f13384105528
Added the atexit module and documentation from Skip Montanaro
Fred Drake <fdrake@acm.org>
parents:
12397
diff
changeset
|
172 at termination, use the \refmodule{atexit} module. Note: the exit function |
|
10465
5868846201ed
SIGTERM is no longer caught to call sys.exitfunc.
Guido van Rossum <guido@python.org>
parents:
9511
diff
changeset
|
173 is not called when the program is killed by a signal, when a Python |
|
5868846201ed
SIGTERM is no longer caught to call sys.exitfunc.
Guido van Rossum <guido@python.org>
parents:
9511
diff
changeset
|
174 fatal internal error is detected, or when \code{os._exit()} is called. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
175 \end{datadesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
176 |
|
15331
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
177 \begin{funcdesc}{getdefaultencoding}{} |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
178 Return the name of the current default string encoding used by the |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
179 Unicode implementation. |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
180 \versionadded{2.0} |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
181 \end{funcdesc} |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
182 |
|
7216
16ecf1554a83
Document getrefcount().
Guido van Rossum <guido@python.org>
parents:
7079
diff
changeset
|
183 \begin{funcdesc}{getrefcount}{object} |
|
16ecf1554a83
Document getrefcount().
Guido van Rossum <guido@python.org>
parents:
7079
diff
changeset
|
184 Return the reference count of the \var{object}. The count returned is |
|
16ecf1554a83
Document getrefcount().
Guido van Rossum <guido@python.org>
parents:
7079
diff
changeset
|
185 generally one higher than you might expect, because it includes the |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8480
diff
changeset
|
186 (temporary) reference as an argument to \function{getrefcount()}. |
|
7216
16ecf1554a83
Document getrefcount().
Guido van Rossum <guido@python.org>
parents:
7079
diff
changeset
|
187 \end{funcdesc} |
|
16ecf1554a83
Document getrefcount().
Guido van Rossum <guido@python.org>
parents:
7079
diff
changeset
|
188 |
|
14308
b8b3f76ffd51
add user-modifiable recursion_limit
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
13977
diff
changeset
|
189 \begin{funcdesc}{getrecursionlimit}{} |
|
b8b3f76ffd51
add user-modifiable recursion_limit
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
13977
diff
changeset
|
190 Return the current value of the recursion limit, the maximum depth of |
|
b8b3f76ffd51
add user-modifiable recursion_limit
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
13977
diff
changeset
|
191 the Python interpreter stack. This limit prevents infinite recursion |
|
b8b3f76ffd51
add user-modifiable recursion_limit
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
13977
diff
changeset
|
192 from causing an overflow of the C stack and crashing Python. It can |
|
14311
97651f28b004
Fix markup error and minor consistency nit.
Fred Drake <fdrake@acm.org>
parents:
14308
diff
changeset
|
193 be set by \function{setrecursionlimit()}. |
|
14308
b8b3f76ffd51
add user-modifiable recursion_limit
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
13977
diff
changeset
|
194 \end{funcdesc} |
|
b8b3f76ffd51
add user-modifiable recursion_limit
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
13977
diff
changeset
|
195 |
|
15487
f0ca4c67957b
_getframe(): New sys module function for getting at the stack frame.
Barry Warsaw <barry@python.org>
parents:
15331
diff
changeset
|
196 \begin{funcdesc}{_getframe}{\optional{depth}} |
|
f0ca4c67957b
_getframe(): New sys module function for getting at the stack frame.
Barry Warsaw <barry@python.org>
parents:
15331
diff
changeset
|
197 Return a frame object from the call stack. If optional integer |
|
f0ca4c67957b
_getframe(): New sys module function for getting at the stack frame.
Barry Warsaw <barry@python.org>
parents:
15331
diff
changeset
|
198 \var{depth} is given, return the frame object that many calls below |
|
f0ca4c67957b
_getframe(): New sys module function for getting at the stack frame.
Barry Warsaw <barry@python.org>
parents:
15331
diff
changeset
|
199 the top of the stack. If that is deeper than the call stack, |
|
f0ca4c67957b
_getframe(): New sys module function for getting at the stack frame.
Barry Warsaw <barry@python.org>
parents:
15331
diff
changeset
|
200 \exception{ValueError} is raised. The default for \var{depth} is |
|
f0ca4c67957b
_getframe(): New sys module function for getting at the stack frame.
Barry Warsaw <barry@python.org>
parents:
15331
diff
changeset
|
201 zero, returning the frame at the top of the call stack. |
|
f0ca4c67957b
_getframe(): New sys module function for getting at the stack frame.
Barry Warsaw <barry@python.org>
parents:
15331
diff
changeset
|
202 |
|
f0ca4c67957b
_getframe(): New sys module function for getting at the stack frame.
Barry Warsaw <barry@python.org>
parents:
15331
diff
changeset
|
203 This function should be used for internal and specialized |
|
f0ca4c67957b
_getframe(): New sys module function for getting at the stack frame.
Barry Warsaw <barry@python.org>
parents:
15331
diff
changeset
|
204 purposes only. |
|
f0ca4c67957b
_getframe(): New sys module function for getting at the stack frame.
Barry Warsaw <barry@python.org>
parents:
15331
diff
changeset
|
205 \end{funcdesc} |
|
f0ca4c67957b
_getframe(): New sys module function for getting at the stack frame.
Barry Warsaw <barry@python.org>
parents:
15331
diff
changeset
|
206 |
|
12395
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
207 \begin{datadesc}{hexversion} |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
208 The version number encoded as a single integer. This is guaranteed to |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
209 increase with each version, including proper support for |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
210 non-production releases. For example, to test that the Python |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
211 interpreter is at least version 1.5.2, use: |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
212 |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
213 \begin{verbatim} |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
214 if sys.hexversion >= 0x010502F0: |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
215 # use some advanced feature |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
216 ... |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
217 else: |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
218 # use an alternative implementation or warn the user |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
219 ... |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
220 \end{verbatim} |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
221 |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
222 This is called \samp{hexversion} since it only really looks meaningful |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
223 when viewed as the result of passing it to the built-in |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
224 \function{hex()} function. The \code{version_info} value may be used |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
225 for a more human-friendly encoding of the same information. |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
226 \versionadded{1.5.2} |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
227 \end{datadesc} |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
228 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
229 \begin{datadesc}{last_type} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
230 \dataline{last_value} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
231 \dataline{last_traceback} |
|
6492
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
232 These three variables are not always defined; they are set when an |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
233 exception is not handled and the interpreter prints an error message |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
234 and a stack traceback. Their intended use is to allow an interactive |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
235 user to import a debugger module and engage in post-mortem debugging |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
236 without having to re-execute the command that caused the error. |
| 7602 | 237 (Typical use is \samp{import pdb; pdb.pm()} to enter the post-mortem |
|
6492
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
238 debugger; see the chapter ``The Python Debugger'' for more |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
239 information.) |
|
6862
c5bfb1de61a5
Fixed index references to modules.
Fred Drake <fdrake@acm.org>
parents:
6662
diff
changeset
|
240 \refstmodindex{pdb} |
|
6492
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
241 |
|
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
242 The meaning of the variables is the same |
| 7602 | 243 as that of the return values from \function{exc_info()} above. |
|
6492
222dd4d06581
Documented exc_info(); also updated exc_type and last_type docs.
Guido van Rossum <guido@python.org>
parents:
5818
diff
changeset
|
244 (Since there is only one interactive thread, thread-safety is not a |
| 7602 | 245 concern for these variables, unlike for \code{exc_type} etc.) |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
246 \end{datadesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
247 |
|
8480
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
248 \begin{datadesc}{maxint} |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
249 The largest positive integer supported by Python's regular integer |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
250 type. This is at least 2**31-1. The largest negative integer is |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
251 \code{-maxint-1} -- the asymmetry results from the use of 2's |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
252 complement binary arithmetic. |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
253 \end{datadesc} |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
254 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
255 \begin{datadesc}{modules} |
| 7602 | 256 This is a dictionary that maps module names to modules which have |
| 257 already been loaded. This can be manipulated to force reloading of | |
| 258 modules and other tricks. Note that removing a module from this | |
| 259 dictionary is \emph{not} the same as calling | |
| 260 \function{reload()}\bifuncindex{reload} on the corresponding module | |
| 261 object. | |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
262 \end{datadesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
263 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
264 \begin{datadesc}{path} |
|
7079
322dca5ee145
Added "module search path" to the index.
Fred Drake <fdrake@acm.org>
parents:
6862
diff
changeset
|
265 \indexiii{module}{search}{path} |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
266 A list of strings that specifies the search path for modules. |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8480
diff
changeset
|
267 Initialized from the environment variable \envvar{PYTHONPATH}, or an |
|
5684
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
268 installation-dependent default. |
|
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
269 |
| 7602 | 270 The first item of this list, \code{path[0]}, is the |
|
5684
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
271 directory containing the script that was used to invoke the Python |
|
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
272 interpreter. If the script directory is not available (e.g. if the |
|
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
273 interpreter is invoked interactively or if the script is read from |
| 7602 | 274 standard input), \code{path[0]} is the empty string, which directs |
|
5684
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
275 Python to search modules in the current directory first. Notice that |
|
6862
c5bfb1de61a5
Fixed index references to modules.
Fred Drake <fdrake@acm.org>
parents:
6662
diff
changeset
|
276 the script directory is inserted \emph{before} the entries inserted as |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8480
diff
changeset
|
277 a result of \envvar{PYTHONPATH}. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
278 \end{datadesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
279 |
|
2817
8b8fb24d4837
correct typo; document sys.platform
Guido van Rossum <guido@python.org>
parents:
2576
diff
changeset
|
280 \begin{datadesc}{platform} |
| 7602 | 281 This string contains a platform identifier, e.g. \code{'sunos5'} or |
| 282 \code{'linux1'}. This can be used to append platform-specific | |
| 283 components to \code{path}, for instance. | |
|
5684
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
284 \end{datadesc} |
|
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
285 |
|
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
286 \begin{datadesc}{prefix} |
|
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
287 A string giving the site-specific directory prefix where the platform |
|
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
288 independent Python files are installed; by default, this is the string |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8480
diff
changeset
|
289 \code{'/usr/local'}. This can be set at build time with the |
|
12380
37d9ded5ab91
Make use of \longprogramopt where appropriate.
Fred Drake <fdrake@acm.org>
parents:
12223
diff
changeset
|
290 \longprogramopt{prefix} argument to the |
|
11457
ef03f16ae5eb
Use the new markup as apporpriate.
Fred Drake <fdrake@acm.org>
parents:
10703
diff
changeset
|
291 \program{configure} script. The main collection of Python library |
|
ef03f16ae5eb
Use the new markup as apporpriate.
Fred Drake <fdrake@acm.org>
parents:
10703
diff
changeset
|
292 modules is installed in the directory \code{prefix + |
|
ef03f16ae5eb
Use the new markup as apporpriate.
Fred Drake <fdrake@acm.org>
parents:
10703
diff
changeset
|
293 '/lib/python\var{version}'} while the platform independent header |
|
ef03f16ae5eb
Use the new markup as apporpriate.
Fred Drake <fdrake@acm.org>
parents:
10703
diff
changeset
|
294 files (all except \file{config.h}) are stored in \code{prefix + |
|
ef03f16ae5eb
Use the new markup as apporpriate.
Fred Drake <fdrake@acm.org>
parents:
10703
diff
changeset
|
295 '/include/python\var{version}'}, where \var{version} is equal to |
|
ef03f16ae5eb
Use the new markup as apporpriate.
Fred Drake <fdrake@acm.org>
parents:
10703
diff
changeset
|
296 \code{version[:3]}. |
|
2817
8b8fb24d4837
correct typo; document sys.platform
Guido van Rossum <guido@python.org>
parents:
2576
diff
changeset
|
297 \end{datadesc} |
|
8b8fb24d4837
correct typo; document sys.platform
Guido van Rossum <guido@python.org>
parents:
2576
diff
changeset
|
298 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
299 \begin{datadesc}{ps1} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
300 \dataline{ps2} |
| 7824 | 301 \index{interpreter prompts} |
| 302 \index{prompts, interpreter} | |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
303 Strings specifying the primary and secondary prompt of the |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
304 interpreter. These are only defined if the interpreter is in |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
305 interactive mode. Their initial values in this case are |
|
15331
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
306 \code{'>\code{>}> '} and \code{'... '}. If a non-string object is assigned |
| 7602 | 307 to either variable, its \function{str()} is re-evaluated each time |
| 308 the interpreter prepares to read a new interactive command; this can | |
| 309 be used to implement a dynamic prompt. | |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
310 \end{datadesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
311 |
|
2109
07080a296070
sys.setcheckinterval(x) instead of sys.check_interval = x
Guido van Rossum <guido@python.org>
parents:
1936
diff
changeset
|
312 \begin{funcdesc}{setcheckinterval}{interval} |
|
07080a296070
sys.setcheckinterval(x) instead of sys.check_interval = x
Guido van Rossum <guido@python.org>
parents:
1936
diff
changeset
|
313 Set the interpreter's ``check interval''. This integer value |
|
07080a296070
sys.setcheckinterval(x) instead of sys.check_interval = x
Guido van Rossum <guido@python.org>
parents:
1936
diff
changeset
|
314 determines how often the interpreter checks for periodic things such |
| 7602 | 315 as thread switches and signal handlers. The default is \code{10}, meaning |
|
2109
07080a296070
sys.setcheckinterval(x) instead of sys.check_interval = x
Guido van Rossum <guido@python.org>
parents:
1936
diff
changeset
|
316 the check is performed every 10 Python virtual instructions. Setting |
|
07080a296070
sys.setcheckinterval(x) instead of sys.check_interval = x
Guido van Rossum <guido@python.org>
parents:
1936
diff
changeset
|
317 it to a larger value may increase performance for programs using |
|
6647
a7ea74a27993
Get rid of math mode in some places.
Guido van Rossum <guido@python.org>
parents:
6492
diff
changeset
|
318 threads. Setting it to a value \code{<=} 0 checks every virtual instruction, |
|
2109
07080a296070
sys.setcheckinterval(x) instead of sys.check_interval = x
Guido van Rossum <guido@python.org>
parents:
1936
diff
changeset
|
319 maximizing responsiveness as well as overhead. |
| 2138 | 320 \end{funcdesc} |
|
2109
07080a296070
sys.setcheckinterval(x) instead of sys.check_interval = x
Guido van Rossum <guido@python.org>
parents:
1936
diff
changeset
|
321 |
|
15331
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
322 \begin{funcdesc}{setdefaultencoding}{name} |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
323 Set the current default string encoding used by the Unicode |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
324 implementation. If \var{name} does not match any available |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
325 encoding, \exception{LookupError} is raised. This function is only |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
326 intended to be used by the \refmodule{site} module implementation |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
327 and, where needed, by \module{sitecustomize}. Once used by the |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
328 \refmodule{site} module, it is removed from the \module{sys} |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
329 module's namespace. |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
330 % Note that \refmodule{site} is not imported if |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
331 % the \programopt{-S} option is passed to the interpreter, in which |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
332 % case this function will remain available. |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
333 \versionadded{2.0} |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
334 \end{funcdesc} |
|
788b523d4827
Additions from Marc-Andre Lemburg <mal@lemburg.com>, documenting
Fred Drake <fdrake@acm.org>
parents:
14311
diff
changeset
|
335 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
336 \begin{funcdesc}{setprofile}{profilefunc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
337 Set the system's profile function, which allows you to implement a |
|
2576
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2491
diff
changeset
|
338 Python source code profiler in Python. See the chapter on the |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2491
diff
changeset
|
339 Python Profiler. The system's profile function |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
340 is called similarly to the system's trace function (see |
| 7602 | 341 \function{settrace()}), but it isn't called for each executed line of |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
342 code (only on call and return and when an exception occurs). Also, |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
343 its return value is not used, so it can just return \code{None}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
344 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
345 \index{profile function} |
|
2576
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2491
diff
changeset
|
346 \index{profiler} |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
347 |
|
14308
b8b3f76ffd51
add user-modifiable recursion_limit
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
13977
diff
changeset
|
348 \begin{funcdesc}{setrecursionlimit}{limit} |
|
b8b3f76ffd51
add user-modifiable recursion_limit
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
13977
diff
changeset
|
349 Set the maximum depth of the Python interpreter stack to \var{limit}. |
|
b8b3f76ffd51
add user-modifiable recursion_limit
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
13977
diff
changeset
|
350 This limit prevents infinite recursion from causing an overflow of the |
|
b8b3f76ffd51
add user-modifiable recursion_limit
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
13977
diff
changeset
|
351 C stack and crashing Python. |
|
b8b3f76ffd51
add user-modifiable recursion_limit
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
13977
diff
changeset
|
352 |
|
b8b3f76ffd51
add user-modifiable recursion_limit
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
13977
diff
changeset
|
353 The highest possible limit is platform-dependent. A user may need to |
|
b8b3f76ffd51
add user-modifiable recursion_limit
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
13977
diff
changeset
|
354 set the limit higher when she has a program that requires deep |
|
b8b3f76ffd51
add user-modifiable recursion_limit
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
13977
diff
changeset
|
355 recursion and a platform that supports a higher limit. This should be |
|
b8b3f76ffd51
add user-modifiable recursion_limit
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
13977
diff
changeset
|
356 done with care, because a too-high limit can lead to a crash. |
|
14311
97651f28b004
Fix markup error and minor consistency nit.
Fred Drake <fdrake@acm.org>
parents:
14308
diff
changeset
|
357 \end{funcdesc} |
|
14308
b8b3f76ffd51
add user-modifiable recursion_limit
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
13977
diff
changeset
|
358 |
|
8480
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
359 \begin{funcdesc}{settrace}{tracefunc} |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
360 Set the system's trace function, which allows you to implement a |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
361 Python source code debugger in Python. See section ``How It Works'' |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
362 in the chapter on the Python Debugger. |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
363 \end{funcdesc} |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
364 \index{trace function} |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
365 \index{debugger} |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
366 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
367 \begin{datadesc}{stdin} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
368 \dataline{stdout} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
369 \dataline{stderr} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
370 File objects corresponding to the interpreter's standard input, |
| 7602 | 371 output and error streams. \code{stdin} is used for all |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
372 interpreter input except for scripts but including calls to |
| 7602 | 373 \function{input()}\bifuncindex{input} and |
| 374 \function{raw_input()}\bifuncindex{raw_input}. \code{stdout} is used | |
| 375 for the output of \keyword{print} and expression statements and for the | |
| 376 prompts of \function{input()} and \function{raw_input()}. The interpreter's | |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
377 own prompts and (almost all of) its error messages go to |
| 7602 | 378 \code{stderr}. \code{stdout} and \code{stderr} needn't |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
379 be built-in file objects: any object is acceptable as long as it has |
| 7602 | 380 a \method{write()} method that takes a string argument. (Changing these |
|
2576
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2491
diff
changeset
|
381 objects doesn't affect the standard I/O streams of processes |
| 7602 | 382 executed by \function{os.popen()}, \function{os.system()} or the |
|
10703
e4e800a78d8d
Make internal module references hyperlinks wherever it makes sense.
Fred Drake <fdrake@acm.org>
parents:
10465
diff
changeset
|
383 \function{exec*()} family of functions in the \refmodule{os} module.) |
|
6862
c5bfb1de61a5
Fixed index references to modules.
Fred Drake <fdrake@acm.org>
parents:
6662
diff
changeset
|
384 \refstmodindex{os} |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
385 \end{datadesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
386 |
|
8480
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
387 \begin{datadesc}{__stdin__} |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
388 \dataline{__stdout__} |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
389 \dataline{__stderr__} |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
390 These objects contain the original values of \code{stdin}, |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
391 \code{stderr} and \code{stdout} at the start of the program. They are |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
392 used during finalization, and could be useful to restore the actual |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
393 files to known working file objects in case they have been overwritten |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
394 with a broken object. |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
395 \end{datadesc} |
|
d93ae374fb99
Document several variables that were previously undocumented,
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
396 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
397 \begin{datadesc}{tracebacklimit} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
398 When this variable is set to an integer value, it determines the |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
399 maximum number of levels of traceback information printed when an |
| 7602 | 400 unhandled exception occurs. The default is \code{1000}. When set to |
| 401 0 or less, all traceback information is suppressed and only the | |
| 402 exception type and value are printed. | |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
403 \end{datadesc} |
|
5684
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
404 |
|
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
405 \begin{datadesc}{version} |
|
12223
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
406 A string containing the version number of the Python interpreter plus |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
407 additional information on the build number and compiler used. It has |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
408 a value of the form \code{'\var{version} (\#\var{build_number}, |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
409 \var{build_date}, \var{build_time}) [\var{compiler}]'}. The first |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
410 three characters are used to identify the version in the installation |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
411 directories (where appropriate on each platform). An example: |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
412 |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
413 \begin{verbatim} |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
414 >>> import sys |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
415 >>> sys.version |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
416 '1.5.2 (#0 Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)]' |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
417 \end{verbatim} |
|
5684
a0831de2358c
Additional info about sys.path, sys.version, sys.prefix, sys.exec_prefix.
Guido van Rossum <guido@python.org>
parents:
4908
diff
changeset
|
418 \end{datadesc} |
|
12223
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
419 |
|
12395
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
420 \begin{datadesc}{version_info} |
|
12397
f0705bcf673b
Update change to version_info structure.
Fred Drake <fdrake@acm.org>
parents:
12395
diff
changeset
|
421 A tuple containing the five components of the version number: |
|
f0705bcf673b
Update change to version_info structure.
Fred Drake <fdrake@acm.org>
parents:
12395
diff
changeset
|
422 \var{major}, \var{minor}, \var{micro}, \var{releaselevel}, and |
|
f0705bcf673b
Update change to version_info structure.
Fred Drake <fdrake@acm.org>
parents:
12395
diff
changeset
|
423 \var{serial}. All values except \var{releaselevel} are integers; the |
|
f0705bcf673b
Update change to version_info structure.
Fred Drake <fdrake@acm.org>
parents:
12395
diff
changeset
|
424 release level is \code{'alpha'}, \code{'beta'}, |
|
f0705bcf673b
Update change to version_info structure.
Fred Drake <fdrake@acm.org>
parents:
12395
diff
changeset
|
425 \code{'candidate'}, or \code{'final'}. The \code{version_info} value |
|
13222
5dd381aeb23b
Update version numbering from 1.6 to 2.0.
Fred Drake <fdrake@acm.org>
parents:
13051
diff
changeset
|
426 corresponding to the Python version 2.0 is |
|
5dd381aeb23b
Update version numbering from 1.6 to 2.0.
Fred Drake <fdrake@acm.org>
parents:
13051
diff
changeset
|
427 \code{(2, 0, 0, 'final', 0)}. |
|
5dd381aeb23b
Update version numbering from 1.6 to 2.0.
Fred Drake <fdrake@acm.org>
parents:
13051
diff
changeset
|
428 \versionadded{2.0} |
|
12395
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
429 \end{datadesc} |
|
3bb398996291
Document hexversion (incompletely explained) and version_info (easily
Fred Drake <fdrake@acm.org>
parents:
12380
diff
changeset
|
430 |
|
12223
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
431 \begin{datadesc}{winver} |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
432 The version number used to form registry keys on Windows platforms. |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
433 This is stored as string resource 1000 in the Python DLL. The value |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
434 is normally the first three characters of \constant{version}. It is |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
435 provided in the \module{sys} module for informational purposes; |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
436 modifying this value has no effect on the registry keys used by |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
437 Python. |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
438 Availability: Windows. |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11457
diff
changeset
|
439 \end{datadesc} |
