[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 |
|
---|
[83f69e5d] | 7 | <!ENTITY python-download-http "http://www.python.org/ftp/python/&Python-version;/Python-&Python-version;.tar.bz2">
|
---|
[fb2e525] | 8 | <!ENTITY python-download-ftp "&gentoo-ftp-repo;/Python-&Python-version;.tar.bz2">
|
---|
[29f47569] | 9 | <!ENTITY python-md5sum "fee5408634a54e721a93531aba37f8c1">
|
---|
[48b816cb] | 10 | <!ENTITY python-size "11 MB">
|
---|
[3a94882] | 11 | <!ENTITY python-buildsize "171 MB (23MB for the test suite, additional 26MB for the documentation)">
|
---|
[48b816cb] | 12 | <!ENTITY python-time "1 SBU (additional 2.9 SBU to run the test suite)">
|
---|
[3a94882] | 13 | <!ENTITY pythonhtmldoc-download-http "http://docs.python.org/ftp/python/doc/&python-majorver;/python-&python-majorver;-docs-html.tar.bz2">
|
---|
| 14 | <!ENTITY pythonhtmldoc-md5sum "cfcd4b9b00ba1e7496b5d823692370a4">
|
---|
| 15 | <!ENTITY pythonhtmldoc-size "3.3 MB">
|
---|
[52d29f7] | 16 | ]>
|
---|
| 17 |
|
---|
[3fe8b511] | 18 | <sect1 id="python" xreflabel="Python-&Python-version;">
|
---|
[256ee72c] | 19 | <?dbhtml filename="python.html" ?>
|
---|
[83f69e5d] | 20 |
|
---|
| 21 | <sect1info>
|
---|
| 22 | <othername>$LastChangedBy$</othername>
|
---|
| 23 | <date>$Date$</date>
|
---|
| 24 | </sect1info>
|
---|
| 25 |
|
---|
| 26 | <title>Python-&Python-version;</title>
|
---|
| 27 |
|
---|
| 28 | <indexterm zone="python">
|
---|
| 29 | <primary sortas="a-Python">Python</primary>
|
---|
| 30 | </indexterm>
|
---|
| 31 |
|
---|
| 32 | <sect2 role="package">
|
---|
| 33 | <title>Introduction to Python</title>
|
---|
| 34 |
|
---|
| 35 | <para>The <application>Python</application> package contains the
|
---|
| 36 | <application>Python</application> development environment.
|
---|
| 37 | This is useful for object-oriented programming, writing scripts,
|
---|
| 38 | prototyping large programs or developing entire applications.</para>
|
---|
| 39 |
|
---|
[48b816cb] | 40 | <!-- Python compiled against Pth, OpenSSL, and SQLite.
|
---|
| 41 | 326 tests OK, 36 tests skipped, 0 failures -->
|
---|
| 42 |
|
---|
| 43 | &lfs65_checked;
|
---|
| 44 |
|
---|
[83f69e5d] | 45 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 46 | <itemizedlist spacing="compact">
|
---|
| 47 | <listitem>
|
---|
| 48 | <para>Download (HTTP): <ulink url="&python-download-http;"/></para>
|
---|
| 49 | </listitem>
|
---|
| 50 | <listitem>
|
---|
| 51 | <para>Download (FTP): <ulink url="&python-download-ftp;"/></para>
|
---|
| 52 | </listitem>
|
---|
| 53 | <listitem>
|
---|
| 54 | <para>Download MD5 sum: &python-md5sum;</para>
|
---|
| 55 | </listitem>
|
---|
| 56 | <listitem>
|
---|
| 57 | <para>Download size: &python-size;</para>
|
---|
| 58 | </listitem>
|
---|
| 59 | <listitem>
|
---|
| 60 | <para>Estimated disk space required: &python-buildsize;</para>
|
---|
| 61 | </listitem>
|
---|
| 62 | <listitem>
|
---|
| 63 | <para>Estimated build time: &python-time;</para>
|
---|
| 64 | </listitem>
|
---|
| 65 | </itemizedlist>
|
---|
| 66 |
|
---|
| 67 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 68 | <itemizedlist spacing='compact'>
|
---|
| 69 | <listitem>
|
---|
[10e02da] | 70 | <para>Required patch: <ulink
|
---|
[2f83800] | 71 | url="&patch-root;/Python-&Python-version;-bdb_4.8-1.patch"/></para>
|
---|
[83f69e5d] | 72 | </listitem>
|
---|
| 73 | </itemizedlist>
|
---|
| 74 |
|
---|
[2f83800] | 75 | <!-- <bridgehead renderas="sect4">Optional Patch</bridgehead>
|
---|
[f4031b6c] | 76 | <itemizedlist spacing='compact'>
|
---|
| 77 | <listitem>
|
---|
| 78 | <para><ulink
|
---|
| 79 | url="&patch-root;/Python-&Python-version;-testing-1.patch"/></para>
|
---|
| 80 | </listitem>
|
---|
[879d269] | 81 | </itemizedlist> -->
|
---|
[f4031b6c] | 82 |
|
---|
[1970f00] | 83 | <itemizedlist spacing='compact'>
|
---|
[3a94882] | 84 | <title>Optional HTML Documentation</title>
|
---|
[1970f00] | 85 | <listitem>
|
---|
[3a94882] | 86 | <para>Download (HTTP): <ulink url="&pythonhtmldoc-download-http;"/></para>
|
---|
| 87 | </listitem>
|
---|
| 88 | <listitem>
|
---|
| 89 | <para>Download MD5 sum: &pythonhtmldoc-md5sum;</para>
|
---|
| 90 | </listitem>
|
---|
| 91 | <listitem>
|
---|
| 92 | <para>Download size: &pythonhtmldoc-size;</para>
|
---|
[1970f00] | 93 | </listitem>
|
---|
| 94 | </itemizedlist>
|
---|
| 95 |
|
---|
[83f69e5d] | 96 | <bridgehead renderas="sect3">Python Dependencies</bridgehead>
|
---|
| 97 |
|
---|
| 98 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[879d269] | 99 | <para role="optional"><xref linkend="pth"/>,
|
---|
| 100 | <xref linkend="gcc"/> (install JAVA for the
|
---|
| 101 | <filename class="libraryfile">libffi</filename> library) or
|
---|
| 102 | <ulink url="http://sourceware.org/libffi/">libffi</ulink>, and
|
---|
| 103 | <ulink url="http://www.bluez.org/">BlueZ</ulink></para>
|
---|
[1970f00] | 104 |
|
---|
| 105 | <bridgehead renderas="sect4">Optional
|
---|
| 106 | (to create package-specific support modules)</bridgehead>
|
---|
[256ee72c] | 107 | <para role="optional"><xref linkend="openssl"/>,
|
---|
[de7f20e] | 108 | <xref linkend="tk"/>,
|
---|
| 109 | <xref linkend="db"/>, and
|
---|
| 110 | <!-- <xref linkend="gdbm"/>, and -->
|
---|
[e2a0e91] | 111 | <xref linkend="sqlite"/></para>
|
---|
[83f69e5d] | 112 |
|
---|
[ce33273] | 113 | <para>Note that there is a circular dependency with the
|
---|
| 114 | <application>Tk</application> package as it requires Xorg to be installed
|
---|
| 115 | but parts of Xorg depend on <application>Python</application>.</para>
|
---|
| 116 |
|
---|
[1039de3] | 117 | <para condition="html" role="usernotes">User Notes:
|
---|
[6c42d4e] | 118 | <ulink url="&blfs-wiki;/Python"/></para>
|
---|
[1039de3] | 119 |
|
---|
[83f69e5d] | 120 | </sect2>
|
---|
| 121 |
|
---|
| 122 | <sect2 role="installation">
|
---|
| 123 | <title>Installation of Python</title>
|
---|
| 124 |
|
---|
| 125 | <para>Install <application>Python</application> by running the following
|
---|
| 126 | commands:</para>
|
---|
| 127 |
|
---|
[879d269] | 128 | <screen><userinput>sed -i "s/ndbm_libs = \[\]/ndbm_libs = ['gdbm', 'gdbm_compat']/" \
|
---|
| 129 | setup.py &&
|
---|
[2f83800] | 130 | patch -Np1 -i ../Python-&Python-version;-bdb_4.8-1.patch &&
|
---|
[879d269] | 131 |
|
---|
[52d29f7] | 132 | ./configure --prefix=/usr --enable-shared &&
|
---|
[83f69e5d] | 133 | make</userinput></screen>
|
---|
| 134 |
|
---|
[1970f00] | 135 | <para>To test the results, issue: <command>make test</command>. Note that
|
---|
| 136 | if you have an existing <application>Python</application> installation
|
---|
| 137 | which includes the <application>PyXML</application> module, the tests could
|
---|
| 138 | produce a segmentation fault.</para>
|
---|
[83f69e5d] | 139 |
|
---|
| 140 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 141 |
|
---|
[2f83800] | 142 | <screen role="root"><userinput>make install &&
|
---|
| 143 | chmod -v 755 /usr/lib/libpython2.6.so.1.0</userinput></screen>
|
---|
[83f69e5d] | 144 |
|
---|
[1970f00] | 145 | <para>There is no documentation installed using the instructions above.
|
---|
[f4031b6c] | 146 | See the <filename>Doc/README.txt</filename> file in the source
|
---|
| 147 | distribution for instructions on how to create the html. Alternatively,
|
---|
| 148 | you can download preformatted documentation from <ulink
|
---|
| 149 | url="http://docs.python.org/download.html"/>.</para>
|
---|
[1970f00] | 150 |
|
---|
[8cebf004] | 151 | <para>In order to use the <command>help ('name_string')</command> feature
|
---|
| 152 | of the <command>python</command> interpreter with some statements and
|
---|
| 153 | keywords, you must download (or create) the optional HTML documentation
|
---|
| 154 | and install it. If you downloaded the HTML docs, issue the following
|
---|
| 155 | commands as the
|
---|
[1970f00] | 156 | <systemitem class="username">root</systemitem> user:</para>
|
---|
| 157 |
|
---|
| 158 | <screen role="root"><userinput>install -v -m755 -d /usr/share/doc/Python-&Python-version;/html &&
|
---|
| 159 | tar --strip-components=1 \
|
---|
[cff8f9e] | 160 | --no-same-owner \
|
---|
| 161 | --no-same-permissions \
|
---|
[1970f00] | 162 | -C /usr/share/doc/Python-&Python-version;/html \
|
---|
[d7e4082] | 163 | -xvf ../python-&python-majorver;-docs-html.tar.bz2</userinput></screen>
|
---|
[1970f00] | 164 |
|
---|
[879d269] | 165 | </sect2>
|
---|
| 166 |
|
---|
| 167 | <sect2 role="commands">
|
---|
| 168 | <title>Command Explanations</title>
|
---|
| 169 |
|
---|
| 170 | <para><command>sed -i "s/ndbm_libs = ..." setup.py</command>: This command
|
---|
| 171 | is used to fix a build problem with the <application>GDBM</application>
|
---|
| 172 | library.</para>
|
---|
| 173 |
|
---|
| 174 | </sect2>
|
---|
| 175 |
|
---|
| 176 | <sect2 role="configuration">
|
---|
| 177 | <title>Configuring Python</title>
|
---|
| 178 |
|
---|
[1970f00] | 179 | <para>In order for <command>python</command> to find the installed
|
---|
| 180 | documentation, you must add the following environment variable to
|
---|
| 181 | individual user's or the system's profile:</para>
|
---|
| 182 |
|
---|
| 183 | <screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/Python-&Python-version;/html</userinput></screen>
|
---|
[83f69e5d] | 184 |
|
---|
| 185 | </sect2>
|
---|
| 186 |
|
---|
| 187 | <sect2 role="content">
|
---|
| 188 | <title>Contents</title>
|
---|
| 189 |
|
---|
| 190 | <segmentedlist>
|
---|
| 191 | <segtitle>Installed Programs</segtitle>
|
---|
| 192 | <segtitle>Installed Libraries</segtitle>
|
---|
| 193 | <segtitle>Installed Directories</segtitle>
|
---|
| 194 |
|
---|
| 195 | <seglistitem>
|
---|
[879d269] | 196 | <seg>2to3, pydoc, python, python-config, python&python-majorver;,
|
---|
| 197 | python&python-majorver;-config, smtpd.py, and optionally if
|
---|
[83f69e5d] | 198 | <application>Tk</application> is installed, idle</seg>
|
---|
[1970f00] | 199 | <seg>libpython&python-majorver;.so and numerous modules installed in
|
---|
| 200 | /usr/lib/python&python-majorver;/lib-dynload</seg>
|
---|
| 201 | <seg>/usr/include/python&python-majorver;,
|
---|
| 202 | /usr/lib/python&python-majorver;, and
|
---|
[fe2cf26] | 203 | /usr/share/doc/python-&Python-version;</seg>
|
---|
[83f69e5d] | 204 | </seglistitem>
|
---|
| 205 | </segmentedlist>
|
---|
| 206 |
|
---|
| 207 | <variablelist>
|
---|
| 208 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 209 | <?dbfo list-presentation="list"?>
|
---|
| 210 | <?dbhtml list-presentation="table"?>
|
---|
| 211 |
|
---|
| 212 | <varlistentry id="idle">
|
---|
| 213 | <term><command>idle</command></term>
|
---|
| 214 | <listitem>
|
---|
[7cd76d62] | 215 | <para>is a wrapper script that opens a
|
---|
[83f69e5d] | 216 | <application>Python</application> aware GUI editor.</para>
|
---|
| 217 | <indexterm zone="python idle">
|
---|
| 218 | <primary sortas="b-idle">idle</primary>
|
---|
| 219 | </indexterm>
|
---|
| 220 | </listitem>
|
---|
| 221 | </varlistentry>
|
---|
| 222 |
|
---|
| 223 | <varlistentry id="pydoc">
|
---|
| 224 | <term><command>pydoc</command></term>
|
---|
| 225 | <listitem>
|
---|
[7cd76d62] | 226 | <para>is the <application>Python</application> documentation
|
---|
[83f69e5d] | 227 | tool.</para>
|
---|
| 228 | <indexterm zone="python pydoc">
|
---|
| 229 | <primary sortas="b-pydoc">pydoc</primary>
|
---|
| 230 | </indexterm>
|
---|
| 231 | </listitem>
|
---|
| 232 | </varlistentry>
|
---|
| 233 |
|
---|
| 234 | <varlistentry id="python-prog">
|
---|
| 235 | <term><command>python</command></term>
|
---|
| 236 | <listitem>
|
---|
[7cd76d62] | 237 | <para>is an interpreted, interactive, object-oriented programming
|
---|
[83f69e5d] | 238 | language.</para>
|
---|
| 239 | <indexterm zone="python python-prog">
|
---|
| 240 | <primary sortas="b-python">python</primary>
|
---|
| 241 | </indexterm>
|
---|
| 242 | </listitem>
|
---|
| 243 | </varlistentry>
|
---|
| 244 |
|
---|
[f67f5387] | 245 | <varlistentry id="python-ver">
|
---|
[1970f00] | 246 | <term><command>python&python-majorver;</command></term>
|
---|
[83f69e5d] | 247 | <listitem>
|
---|
[0619e6d] | 248 | <para>is a version-specific name for the <command>python</command>
|
---|
[83f69e5d] | 249 | program.</para>
|
---|
[f67f5387] | 250 | <indexterm zone="python python-ver">
|
---|
[1970f00] | 251 | <primary sortas="b-python&python-majorver;">python&python-majorver;</primary>
|
---|
[83f69e5d] | 252 | </indexterm>
|
---|
| 253 | </listitem>
|
---|
| 254 | </varlistentry>
|
---|
| 255 |
|
---|
| 256 | <varlistentry id="smtpd.py">
|
---|
| 257 | <term><command>smtpd.py</command></term>
|
---|
| 258 | <listitem>
|
---|
[7cd76d62] | 259 | <para>is an SMTP proxy implemented in
|
---|
[83f69e5d] | 260 | <application>Python</application>.</para>
|
---|
| 261 | <indexterm zone="python smtpd.py">
|
---|
| 262 | <primary sortas="b-smtpd.py">smtpd.py</primary>
|
---|
| 263 | </indexterm>
|
---|
| 264 | </listitem>
|
---|
| 265 | </varlistentry>
|
---|
| 266 |
|
---|
| 267 | </variablelist>
|
---|
| 268 |
|
---|
| 269 | </sect2>
|
---|
[f45b1953] | 270 |
|
---|
| 271 | </sect1>
|
---|