annotate Doc/lib/libplatform.tex @ 32527:0da660e05e69 legacy-trunk

"#if WITH_THREAD" is incorrect; must be #ifdef instead; WITH_THREAD isn't always set to an integer value when it's defined.
author Tim Peters <tim.peters@gmail.com>
date Wed, 07 Jul 2004 20:42:07 +0000
parents 38b94c05b85b
children 67f2190e1f6d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
1 \section{\module{platform} ---
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
2 Access to underlying platform's identifying data.}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
3
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
4 \declaremodule{standard}{platform}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
5 \modulesynopsis{Retrieves as much platform identifying data as possible.}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
6 \moduleauthor{Marc-Andre Lemburg}{mal@egenix.com}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
7 \sectionauthor{Bjorn Pettersen}{bpettersen@corp.fairisaac.com}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
8
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
9 \versionadded{2.3}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
10
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
11 \begin{notice}
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
12 Specific platforms listed alphabetically, with Linux included in the
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
13 \UNIX{} section.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
14 \end{notice}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
15
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
16 \subsection{Cross Platform}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
17
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
18 \begin{funcdesc}{architecture}{executable=sys.executable, bits='', linkage=''}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
19 Queries the given executable (defaults to the Python interpreter
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
20 binary) for various architecture informations.
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
21
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
22 Returns a tuple \code{(bits, linkage)} which contain information about
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
23 the bit architecture and the linkage format used for the
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
24 executable. Both values are returned as strings.
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
25
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
26 Values that cannot be determined are returned as given by the
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
27 parameter presets. If bits is given as \code{''}, the
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
28 \cfunction{sizeof(pointer)}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
29 (or \cfunction{sizeof(long)} on Python version < 1.5.2) is used as
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
30 indicator for the supported pointer size.
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
31
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
32 The function relies on the system's \file{file} command to do the
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
33 actual work. This is available on most if not all \UNIX{}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
34 platforms and some non-\UNIX{} platforms and then only if the
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
35 executable points to the Python interpreter. Reasonable defaults
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
36 are used when the above needs are not met.
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
37 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
38
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
39 \begin{funcdesc}{machine}{}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
40 Returns the machine type, e.g. \code{'i386'}.
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
41 An empty string is returned if the value cannot be determined.
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
42 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
43
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
44 \begin{funcdesc}{node}{}
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
45 Returns the computer's network name (may not be fully qualified!).
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
46 An empty string is returned if the value cannot be determined.
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
47 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
48
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
49 \begin{funcdesc}{platform}{aliased=0, terse=0}
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
50 Returns a single string identifying the underlying platform
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
51 with as much useful information as possible.
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
52
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
53 The output is intended to be \emph{human readable} rather than
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
54 machine parseable. It may look different on different platforms and
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
55 this is intended.
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
56
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
57 If \var{aliased} is true, the function will use aliases for various
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
58 platforms that report system names which differ from their common
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
59 names, for example SunOS will be reported as Solaris. The
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
60 \function{system_alias()} function is used to implement this.
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
61
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
62 Setting \var{terse} to true causes the function to return only the
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
63 absolute minimum information needed to identify the platform.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
64 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
65
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
66 \begin{funcdesc}{processor}{}
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
67 Returns the (real) processor name, e.g. \code{'amdk6'}.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
68
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
69 An empty string is returned if the value cannot be determined. Note
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
70 that many platforms do not provide this information or simply return
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
71 the same value as for \function{machine()}. NetBSD does this.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
72 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
73
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
74 \begin{funcdesc}{python_build}{}
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
75 Returns a tuple \code{(\var{buildno}, \var{builddate})} stating the
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
76 Python build number and date as strings.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
77 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
78
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
79 \begin{funcdesc}{python_compiler}{}
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
80 Returns a string identifying the compiler used for compiling Python.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
81 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
82
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
83 \begin{funcdesc}{python_version}{}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
84 Returns the Python version as string \code{'major.minor.patchlevel'}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
85
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
86 Note that unlike the Python \code{sys.version}, the returned value
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
87 will always include the patchlevel (it defaults to 0).
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
88 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
89
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
90 \begin{funcdesc}{python_version_tuple}{}
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
91 Returns the Python version as tuple \code{(\var{major}, \var{minor},
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
92 \var{patchlevel})} of strings.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
93
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
94 Note that unlike the Python \code{sys.version}, the returned value
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
95 will always include the patchlevel (it defaults to \code{'0'}).
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
96 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
97
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
98 \begin{funcdesc}{release}{}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
99 Returns the system's release, e.g. \code{'2.2.0'} or \code{'NT'}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
100 An empty string is returned if the value cannot be determined.
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
101 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
102
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
103 \begin{funcdesc}{system}{}
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
104 Returns the system/OS name, e.g. \code{'Linux'}, \code{'Windows'},
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
105 or \code{'Java'}.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
106 An empty string is returned if the value cannot be determined.
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
107 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
108
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
109 \begin{funcdesc}{system_alias}{system, release, version}
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
110 Returns \code{(\var{system}, \var{release}, \var{version})} aliased
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
111 to common marketing names used for some systems. It also does some
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
112 reordering of the information in some cases where it would otherwise
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
113 cause confusion.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
114 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
115
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
116 \begin{funcdesc}{version}{}
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
117 Returns the system's release version, e.g. \code{'\#3 on degas'}.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
118 An empty string is returned if the value cannot be determined.
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
119 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
120
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
121 \begin{funcdesc}{uname}{}
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
122 Fairly portable uname interface. Returns a tuple of strings
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
123 \code{(\var{system}, \var{node}, \var{release}, \var{version},
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
124 \var{machine}, \var{processor})} identifying the underlying
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
125 platform.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
126
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
127 Note that unlike the \function{os.uname()} function this also returns
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
128 possible processor information as additional tuple entry.
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
129
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
130 Entries which cannot be determined are set to \code{''}.
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
131 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
132
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
133
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
134 \subsection{Java Platform}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
135
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
136 \begin{funcdesc}{java_ver}{release='', vendor='', vminfo=('','',''),
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
137 osinfo=('','','')}
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
138 Version interface for JPython.
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
139
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
140 Returns a tuple \code{(\var{release}, \var{vendor}, \var{vminfo},
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
141 \var{osinfo})} with \var{vminfo} being a tuple \code{(\var{vm_name},
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
142 \var{vm_release}, \var{vm_vendor})} and \var{osinfo} being a tuple
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
143 \code{(\var{os_name}, \var{os_version}, \var{os_arch})}.
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
144 Values which cannot be determined are set to the defaults
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
145 given as parameters (which all default to \code{''}).
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
146 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
147
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
148
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
149 \subsection{Windows Platform}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
150
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
151 \begin{funcdesc}{win32_ver}{release='', version='', csd='', ptype=''}
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
152 Get additional version information from the Windows Registry
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
153 and return a tuple \code{(\var{version}, \var{csd}, \var{ptype})}
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
154 referring to version number, CSD level and OS type (multi/single
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
155 processor).
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
156
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
157 As a hint: \var{ptype} is \code{'Uniprocessor Free'} on single
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
158 processor NT machines and \code{'Multiprocessor Free'} on multi
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
159 processor machines. The \emph{'Free'} refers to the OS version being
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
160 free of debugging code. It could also state \emph{'Checked'} which
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
161 means the OS version uses debugging code, i.e. code that
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
162 checks arguments, ranges, etc.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
163
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
164 \begin{notice}[note]
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
165 This function only works if Mark Hammond's \module{win32all}
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
166 package is installed and (obviously) only runs on Win32
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
167 compatible platforms.
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
168 \end{notice}
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
169 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
170
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
171 \subsubsection{Win95/98 specific}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
172
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
173 \begin{funcdesc}{popen}{cmd, mode='r', bufsize=None}
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
174 Portable \function{popen()} interface. Find a working popen
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
175 implementation preferring \function{win32pipe.popen()}. On Windows
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
176 NT, \function{win32pipe.popen()} should work; on Windows 9x it hangs
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
177 due to bugs in the MS C library.
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
178 % This KnowledgeBase article appears to be missing...
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
179 %See also \ulink{MS KnowledgeBase article Q150956}{}.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
180 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
181
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
182
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
183 \subsection{Mac OS Platform}
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
184
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
185 \begin{funcdesc}{mac_ver}{release='', versioninfo=('','',''), machine=''}
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
186 Get Mac OS version information and return it as tuple
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
187 \code{(\var{release}, \var{versioninfo}, \var{machine})} with
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
188 \var{versioninfo} being a tuple \code{(\var{version},
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
189 \var{dev_stage}, \var{non_release_version})}.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
190
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
191 Entries which cannot be determined are set to \code{''}. All tuple
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
192 entries are strings.
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
193
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
194 Documentation for the underlying \cfunction{gestalt()} API is
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
195 available online at \url{http://www.rgaros.nl/gestalt/}.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
196 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
197
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
198
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
199 \subsection{\UNIX{} Platforms}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
200
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
201 \begin{funcdesc}{dist}{distname='', version='', id='',
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
202 supported_dists=('SuSE','debian','redhat','mandrake')}
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
203 Tries to determine the name of the OS distribution name
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
204 Returns a tuple \code{(\var{distname}, \var{version}, \var{id})}
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
205 which defaults to the args given as parameters.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
206 \end{funcdesc}
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
207
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
208
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
209 \begin{funcdesc}{libc_ver}{executable=sys.executable, lib='',
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
210 version='', chunksize=2048}
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
211 Tries to determine the libc version against which the file
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
212 executable (defaults to the Python interpreter) is linked. Returns
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
213 a tuple of strings \code{(\var{lib}, \var{version})} which default
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
214 to the given parameters in case the lookup fails.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
215
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
216 Note that this function has intimate knowledge of how different
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
217 libc versions add symbols to the executable is probably only
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
218 useable for executables compiled using \program{gcc}.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
219
30739
38b94c05b85b - make this section format
Fred Drake <fdrake@acm.org>
parents: 30693
diff changeset
220 The file is read and scanned in chunks of \var{chunksize} bytes.
30693
4388bbad0bc3 Initial checkin of docs for Lib/platform.py .
Brett Cannon <bcannon@gmail.com>
parents:
diff changeset
221 \end{funcdesc}