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