[52d29f7] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[52d29f7] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[2cee003] | 7 | <!ENTITY python3-download-http
|
---|
[355495ce] | 8 | "http://www.python.org/ftp/python/&python3-version;/Python-&python3-version;.tar.xz">
|
---|
| 9 | <!ENTITY python3-download-ftp " ">
|
---|
[c525bd1] | 10 | <!ENTITY python3-md5sum "2e7533b4009ac4adae62a7797a442e7a">
|
---|
| 11 | <!ENTITY python3-size "11.2 MB">
|
---|
| 12 | <!ENTITY python3-buildsize "141 MB (additional 32 MB for the test suite)">
|
---|
| 13 | <!ENTITY python3-time "1.2 SBU (additional 2.2 SBU to run the test suite)">
|
---|
[2cee003] | 14 | <!ENTITY python3htmldoc-download-http
|
---|
[355495ce] | 15 | "http://docs.python.org/ftp/python/doc/&python3-version;/python-&python3-version;-docs-html.tar.bz2">
|
---|
[c525bd1] | 16 | <!ENTITY python3htmldoc-md5sum "d8de7264eb5b03b54044825b765324c7">
|
---|
| 17 | <!ENTITY python3htmldoc-size "4.6 MB">
|
---|
[52d29f7] | 18 | ]>
|
---|
| 19 |
|
---|
[b88be39] | 20 | <sect1 id="python3" xreflabel="Python-&python3-version;">
|
---|
| 21 | <?dbhtml filename="python3.html" ?>
|
---|
[83f69e5d] | 22 |
|
---|
| 23 | <sect1info>
|
---|
| 24 | <othername>$LastChangedBy$</othername>
|
---|
| 25 | <date>$Date$</date>
|
---|
| 26 | </sect1info>
|
---|
| 27 |
|
---|
[b88be39] | 28 | <title>Python-&python3-version;</title>
|
---|
[83f69e5d] | 29 |
|
---|
[b88be39] | 30 | <indexterm zone="python3">
|
---|
| 31 | <primary sortas="a-Python3">Python</primary>
|
---|
[83f69e5d] | 32 | </indexterm>
|
---|
| 33 |
|
---|
| 34 | <sect2 role="package">
|
---|
| 35 | <title>Introduction to Python</title>
|
---|
| 36 |
|
---|
[355495ce] | 37 | <para>
|
---|
| 38 | The <application>Python</application> package contains the
|
---|
| 39 | <application>Python</application> development environment.
|
---|
| 40 | This is useful for object-oriented programming, writing scripts,
|
---|
| 41 | prototyping large programs or developing entire applications.
|
---|
| 42 | </para>
|
---|
[48b816cb] | 43 |
|
---|
[c525bd1] | 44 | &lfs72_checked;
|
---|
[48b816cb] | 45 |
|
---|
[83f69e5d] | 46 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 47 | <itemizedlist spacing="compact">
|
---|
| 48 | <listitem>
|
---|
[355495ce] | 49 | <para>
|
---|
| 50 | Download (HTTP): <ulink url="&python3-download-http;"/>
|
---|
| 51 | </para>
|
---|
[83f69e5d] | 52 | </listitem>
|
---|
| 53 | <listitem>
|
---|
[355495ce] | 54 | <para>
|
---|
| 55 | Download (FTP): <ulink url="&python3-download-ftp;"/>
|
---|
| 56 | </para>
|
---|
[83f69e5d] | 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
[355495ce] | 59 | <para>
|
---|
| 60 | Download MD5 sum: &python3-md5sum;
|
---|
| 61 | </para>
|
---|
[83f69e5d] | 62 | </listitem>
|
---|
| 63 | <listitem>
|
---|
[355495ce] | 64 | <para>
|
---|
| 65 | Download size: &python3-size;
|
---|
| 66 | </para>
|
---|
[83f69e5d] | 67 | </listitem>
|
---|
| 68 | <listitem>
|
---|
[355495ce] | 69 | <para>
|
---|
| 70 | Estimated disk space required: &python3-buildsize;
|
---|
| 71 | </para>
|
---|
[83f69e5d] | 72 | </listitem>
|
---|
| 73 | <listitem>
|
---|
[355495ce] | 74 | <para>
|
---|
| 75 | Estimated build time: &python3-time;
|
---|
| 76 | </para>
|
---|
[83f69e5d] | 77 | </listitem>
|
---|
| 78 | </itemizedlist>
|
---|
| 79 |
|
---|
| 80 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
[355495ce] | 81 | <itemizedlist spacing="compact">
|
---|
[3a94882] | 82 | <title>Optional HTML Documentation</title>
|
---|
[1970f00] | 83 | <listitem>
|
---|
[355495ce] | 84 | <para>
|
---|
| 85 | Download (HTTP): <ulink url="&python3htmldoc-download-http;"/>
|
---|
| 86 | </para>
|
---|
[3a94882] | 87 | </listitem>
|
---|
| 88 | <listitem>
|
---|
[355495ce] | 89 | <para>
|
---|
| 90 | Download MD5 sum: &python3htmldoc-md5sum;
|
---|
| 91 | </para>
|
---|
[3a94882] | 92 | </listitem>
|
---|
| 93 | <listitem>
|
---|
[355495ce] | 94 | <para>
|
---|
| 95 | Download size: &python3htmldoc-size;
|
---|
| 96 | </para>
|
---|
[1970f00] | 97 | </listitem>
|
---|
| 98 | </itemizedlist>
|
---|
| 99 |
|
---|
[83f69e5d] | 100 | <bridgehead renderas="sect3">Python Dependencies</bridgehead>
|
---|
| 101 |
|
---|
[355495ce] | 102 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 103 | <para role="recommended">
|
---|
| 104 | <xref linkend="expat"/> and
|
---|
| 105 | <xref linkend="libffi"/>
|
---|
| 106 | </para>
|
---|
| 107 |
|
---|
[83f69e5d] | 108 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[355495ce] | 109 | <para role="optional">
|
---|
| 110 | <xref linkend="bluez"/>
|
---|
| 111 | </para>
|
---|
| 112 |
|
---|
| 113 | <bridgehead renderas="sect4">Optional (For Additional Modules)</bridgehead>
|
---|
| 114 | <para role="optional">
|
---|
| 115 | <xref linkend="db"/>
|
---|
| 116 | <xref linkend="openssl"/>,
|
---|
| 117 | <xref linkend="sqlite"/> and
|
---|
| 118 | <xref linkend="tk"/>
|
---|
| 119 | </para>
|
---|
[ce33273] | 120 |
|
---|
[1039de3] | 121 | <para condition="html" role="usernotes">User Notes:
|
---|
[355495ce] | 122 | <ulink url="&blfs-wiki;/Python3"/>
|
---|
| 123 | </para>
|
---|
[83f69e5d] | 124 | </sect2>
|
---|
| 125 |
|
---|
| 126 | <sect2 role="installation">
|
---|
| 127 | <title>Installation of Python</title>
|
---|
| 128 |
|
---|
[355495ce] | 129 | <para>
|
---|
| 130 | Install <application>Python</application> by running the following
|
---|
| 131 | commands:
|
---|
| 132 | </para>
|
---|
[83f69e5d] | 133 |
|
---|
[955b7fd2] | 134 | <screen><userinput>sed -i "s/ndbm_libs = \[\]/ndbm_libs = ['gdbm', 'gdbm_compat']/" setup.py &&
|
---|
[c525bd1] | 135 | ./configure --prefix=/usr \
|
---|
| 136 | --enable-shared \
|
---|
[355495ce] | 137 | --with-system-expat \
|
---|
| 138 | --with-system-ffi &&
|
---|
[83f69e5d] | 139 | make</userinput></screen>
|
---|
| 140 |
|
---|
[355495ce] | 141 | <para>
|
---|
| 142 | To test the results, issue: <command>make test</command>. Note that
|
---|
| 143 | if you have an existing <application>Python</application> installation
|
---|
| 144 | which includes the <application>PyXML</application> module, the tests could
|
---|
| 145 | produce a segmentation fault.
|
---|
| 146 | </para>
|
---|
| 147 |
|
---|
| 148 | <para>
|
---|
| 149 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 150 | </para>
|
---|
| 151 |
|
---|
| 152 | <screen role="root"><userinput>make install &&
|
---|
[c525bd1] | 153 | chmod -v 755 /usr/lib/libpython&python3-majorver;m.so &&
|
---|
[355495ce] | 154 | chmod -v 755 /usr/lib/libpython3.so</userinput></screen>
|
---|
| 155 |
|
---|
| 156 | <para>
|
---|
| 157 | There is no documentation installed using the instructions above.
|
---|
| 158 | See the <filename>Doc/README.txt</filename> file in the source
|
---|
| 159 | distribution for instructions on how to create the html. Alternatively,
|
---|
| 160 | you can download preformatted documentation from
|
---|
| 161 | <ulink url="http://docs.python.org/download.html"/>.
|
---|
| 162 | </para>
|
---|
| 163 |
|
---|
| 164 | <para>
|
---|
| 165 | In order to use the <command>help ('name_string')</command> feature
|
---|
| 166 | of the <command>python</command> interpreter with some statements and
|
---|
| 167 | keywords, you must download (or create) the optional HTML documentation
|
---|
| 168 | and install it. If you downloaded the HTML docs, issue the following
|
---|
| 169 | commands as the <systemitem class="username">root</systemitem> user:
|
---|
| 170 | </para>
|
---|
[1970f00] | 171 |
|
---|
[b88be39] | 172 | <screen role="root"><userinput>install -v -m755 -d /usr/share/doc/Python-&python3-version;/html &&
|
---|
[1970f00] | 173 | tar --strip-components=1 \
|
---|
[cff8f9e] | 174 | --no-same-owner \
|
---|
| 175 | --no-same-permissions \
|
---|
[b88be39] | 176 | -C /usr/share/doc/Python-&python3-version;/html \
|
---|
[716ca8aa] | 177 | -xvf ../python-&python3-version;-docs-html.tar.bz2</userinput></screen>
|
---|
[1970f00] | 178 |
|
---|
[879d269] | 179 | </sect2>
|
---|
| 180 |
|
---|
| 181 | <sect2 role="commands">
|
---|
| 182 | <title>Command Explanations</title>
|
---|
| 183 |
|
---|
[355495ce] | 184 | <para>
|
---|
| 185 | <command>sed -i "s/ndbm_libs = ..." setup.py</command>: This command
|
---|
| 186 | is used to fix a build problem with the <application>GDBM</application>
|
---|
| 187 | library.
|
---|
| 188 | </para>
|
---|
| 189 |
|
---|
| 190 | <para>
|
---|
| 191 | <option>--with-sytem-expat</option>: This switch enables linking against
|
---|
| 192 | system version of <application>Expat</application>. Remove if you have
|
---|
| 193 | not installed recommended dependency <xref linkend="expat"/>.
|
---|
| 194 | </para>
|
---|
| 195 |
|
---|
| 196 | <para>
|
---|
| 197 | <option>--with-system-ffi</option>: This switch enables linking against
|
---|
| 198 | system version of <application>libffi</application>. Remove if you have
|
---|
| 199 | not installed recommended dependency <xref linkend="libffi"/>.
|
---|
| 200 | </para>
|
---|
| 201 |
|
---|
| 202 | <para>
|
---|
| 203 | <command>chmod ...</command>: Fix permissions for shared libraries to be
|
---|
| 204 | consistent with other libraries.
|
---|
| 205 | </para>
|
---|
[7224506] | 206 |
|
---|
[879d269] | 207 | </sect2>
|
---|
| 208 |
|
---|
| 209 | <sect2 role="configuration">
|
---|
| 210 | <title>Configuring Python</title>
|
---|
| 211 |
|
---|
[355495ce] | 212 | <para>
|
---|
| 213 | In order for <command>python</command> to find the installed
|
---|
| 214 | documentation, you must add the following environment variable to
|
---|
| 215 | individual user's or the system's profile:
|
---|
| 216 | </para>
|
---|
[1970f00] | 217 |
|
---|
[2cee003] | 218 | <screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/Python-&python3-version;/html</userinput></screen>
|
---|
[83f69e5d] | 219 |
|
---|
| 220 | </sect2>
|
---|
| 221 |
|
---|
| 222 | <sect2 role="content">
|
---|
| 223 | <title>Contents</title>
|
---|
| 224 |
|
---|
| 225 | <segmentedlist>
|
---|
| 226 | <segtitle>Installed Programs</segtitle>
|
---|
| 227 | <segtitle>Installed Libraries</segtitle>
|
---|
| 228 | <segtitle>Installed Directories</segtitle>
|
---|
| 229 |
|
---|
| 230 | <seglistitem>
|
---|
[355495ce] | 231 | <seg>
|
---|
| 232 | 2to3 (symbolic link to 2to3-&python3-majorver;),
|
---|
| 233 | 2to3-&python3-majorver;,
|
---|
| 234 |
|
---|
| 235 | pydoc3 (symbolic link to pydoc&python3-majorver;),
|
---|
| 236 | pydoc&python3-majorver;,
|
---|
| 237 |
|
---|
[c525bd1] | 238 | python3 (hard link to python&python3-majorver;m),
|
---|
| 239 | python&python3-majorver; (hard link to python&python3-majorver;m),
|
---|
| 240 | python&python3-majorver;m,
|
---|
[355495ce] | 241 |
|
---|
| 242 | python3-config (symbolic link to python&python3-majorver;-config),
|
---|
| 243 | python&python3-majorver;-config (symbolic link to python3-config),
|
---|
[c525bd1] | 244 | python&python3-majorver;m-config,
|
---|
[355495ce] | 245 |
|
---|
| 246 | and optionally if Tk is installed,
|
---|
| 247 | idle3 (symbolic link to idle&python3-majorver;),
|
---|
| 248 | idle&python3-majorver;
|
---|
| 249 | </seg>
|
---|
| 250 | <seg>
|
---|
[c525bd1] | 251 | libpython&python3-majorver;m.so, libpython3.so and numerous
|
---|
[355495ce] | 252 | modules installed in /usr/lib/python&python3-majorver;
|
---|
| 253 | </seg>
|
---|
| 254 | <seg>
|
---|
[c525bd1] | 255 | /usr/include/python&python3-majorver;m,
|
---|
[355495ce] | 256 | /usr/lib/python&python3-majorver;, and
|
---|
| 257 | /usr/share/doc/python-&python3-version;
|
---|
| 258 | </seg>
|
---|
[83f69e5d] | 259 | </seglistitem>
|
---|
| 260 | </segmentedlist>
|
---|
| 261 |
|
---|
| 262 | <variablelist>
|
---|
| 263 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 264 | <?dbfo list-presentation="list"?>
|
---|
| 265 | <?dbhtml list-presentation="table"?>
|
---|
| 266 |
|
---|
[355495ce] | 267 | <varlistentry id="idle3">
|
---|
| 268 | <term><command>idle3</command></term>
|
---|
[83f69e5d] | 269 | <listitem>
|
---|
[355495ce] | 270 | <para>
|
---|
| 271 | is a wrapper script that opens a
|
---|
| 272 | <application>Python</application> aware GUI editor.
|
---|
| 273 | </para>
|
---|
| 274 | <indexterm zone="python3 idle3">
|
---|
| 275 | <primary sortas="b-idle3">idle3</primary>
|
---|
[83f69e5d] | 276 | </indexterm>
|
---|
| 277 | </listitem>
|
---|
| 278 | </varlistentry>
|
---|
| 279 |
|
---|
[355495ce] | 280 | <varlistentry id="pydoc3">
|
---|
| 281 | <term><command>pydoc3</command></term>
|
---|
[83f69e5d] | 282 | <listitem>
|
---|
[355495ce] | 283 | <para>
|
---|
| 284 | is the <application>Python</application> documentation
|
---|
| 285 | tool.
|
---|
| 286 | </para>
|
---|
| 287 | <indexterm zone="python3 pydoc3">
|
---|
| 288 | <primary sortas="b-pydoc3">pydo3c</primary>
|
---|
[83f69e5d] | 289 | </indexterm>
|
---|
| 290 | </listitem>
|
---|
| 291 | </varlistentry>
|
---|
| 292 |
|
---|
[b88be39] | 293 | <varlistentry id="python3-prog">
|
---|
[2cee003] | 294 | <term><command>python3</command></term>
|
---|
[83f69e5d] | 295 | <listitem>
|
---|
[355495ce] | 296 | <para>
|
---|
| 297 | is an interpreted, interactive, object-oriented programming
|
---|
| 298 | language.
|
---|
| 299 | </para>
|
---|
[b88be39] | 300 | <indexterm zone="python3 python3-prog">
|
---|
| 301 | <primary sortas="b-python3">python3</primary>
|
---|
[83f69e5d] | 302 | </indexterm>
|
---|
| 303 | </listitem>
|
---|
| 304 | </varlistentry>
|
---|
| 305 |
|
---|
[f67f5387] | 306 | <varlistentry id="python-ver">
|
---|
[b88be39] | 307 | <term><command>python&python3-majorver;</command></term>
|
---|
[83f69e5d] | 308 | <listitem>
|
---|
[355495ce] | 309 | <para>
|
---|
| 310 | is a version-specific name for the <command>python</command>
|
---|
| 311 | program.
|
---|
| 312 | </para>
|
---|
[b88be39] | 313 | <indexterm zone="python3 python-ver">
|
---|
[2cee003] | 314 | <primary
|
---|
| 315 | sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
|
---|
[83f69e5d] | 316 | </indexterm>
|
---|
| 317 | </listitem>
|
---|
| 318 | </varlistentry>
|
---|
| 319 |
|
---|
| 320 | </variablelist>
|
---|
| 321 |
|
---|
| 322 | </sect2>
|
---|
[f45b1953] | 323 |
|
---|
| 324 | </sect1>
|
---|