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