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