[bf847d6d] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[181662f] | 7 | <!ENTITY python2-download-http
|
---|
[82fac2c] | 8 | "http://www.python.org/ftp/python/&python2-version;/Python-&python2-version;.tar.xz">
|
---|
[27d9434] | 9 | <!ENTITY python2-download-ftp " ">
|
---|
[4af4be4] | 10 | <!ENTITY python2-md5sum "5eea8462f69ab1369d32f9c4cd6272ab">
|
---|
[388d294] | 11 | <!ENTITY python2-size "9.8 MB">
|
---|
[23d3543c] | 12 | <!ENTITY python2-buildsize "235 MB">
|
---|
| 13 | <!ENTITY python2-time "1.0 SBU">
|
---|
[82fac2c] | 14 |
|
---|
[181662f] | 15 | <!ENTITY python2htmldoc-download-http
|
---|
[82fac2c] | 16 | "http://docs.python.org/ftp/python/doc/&python2-version;/python-&python2-version;-docs-html.tar.bz2">
|
---|
[4af4be4] | 17 | <!ENTITY python2htmldoc-md5sum "77ae8fd6b456c6339a1a62d57425335b">
|
---|
[03d30cf] | 18 | <!ENTITY python2htmldoc-size "4.3 MB">
|
---|
[bf847d6d] | 19 | ]>
|
---|
| 20 |
|
---|
[4716d52] | 21 | <sect1 id="python2" xreflabel="Python-&python2-version;">
|
---|
[bf847d6d] | 22 | <?dbhtml filename="python2.html" ?>
|
---|
| 23 |
|
---|
| 24 | <sect1info>
|
---|
[4949485e] | 25 | <othername>$LastChangedBy$</othername>
|
---|
| 26 | <date>$Date$</date>
|
---|
[bf847d6d] | 27 | </sect1info>
|
---|
| 28 |
|
---|
| 29 | <title>Python-&python2-version;</title>
|
---|
| 30 |
|
---|
[4716d52] | 31 | <indexterm zone="python2">
|
---|
[82fac2c] | 32 | <primary sortas="a-Python2">Python2</primary>
|
---|
[bf847d6d] | 33 | </indexterm>
|
---|
| 34 |
|
---|
| 35 | <sect2 role="package">
|
---|
| 36 | <title>Introduction to Python 2</title>
|
---|
| 37 |
|
---|
[181662f] | 38 | <para>
|
---|
| 39 | The <application>Python 2</application> package contains the
|
---|
[82fac2c] | 40 | <application>Python</application> development environment. It is useful
|
---|
[181662f] | 41 | for object-oriented programming, writing scripts, prototyping large
|
---|
| 42 | programs or developing entire applications. This version is for backward
|
---|
| 43 | compatibility with other dependent packages.
|
---|
| 44 | </para>
|
---|
[bf847d6d] | 45 |
|
---|
[36fbdb9] | 46 | &lfs73_checked;
|
---|
[bf847d6d] | 47 |
|
---|
| 48 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 49 | <itemizedlist spacing="compact">
|
---|
| 50 | <listitem>
|
---|
[181662f] | 51 | <para>
|
---|
| 52 | Download (HTTP): <ulink url="&python2-download-http;"/>
|
---|
| 53 | </para>
|
---|
[bf847d6d] | 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
[181662f] | 56 | <para>
|
---|
| 57 | Download (FTP): <ulink url="&python2-download-ftp;"/>
|
---|
| 58 | </para>
|
---|
[bf847d6d] | 59 | </listitem>
|
---|
| 60 | <listitem>
|
---|
[181662f] | 61 | <para>
|
---|
| 62 | Download MD5 sum: &python2-md5sum;
|
---|
| 63 | </para>
|
---|
[bf847d6d] | 64 | </listitem>
|
---|
| 65 | <listitem>
|
---|
[181662f] | 66 | <para>
|
---|
| 67 | Download size: &python2-size;
|
---|
| 68 | </para>
|
---|
[bf847d6d] | 69 | </listitem>
|
---|
| 70 | <listitem>
|
---|
[181662f] | 71 | <para>
|
---|
| 72 | Estimated disk space required: &python2-buildsize;
|
---|
| 73 | </para>
|
---|
[bf847d6d] | 74 | </listitem>
|
---|
| 75 | <listitem>
|
---|
[181662f] | 76 | <para>
|
---|
| 77 | Estimated build time: &python2-time;
|
---|
| 78 | </para>
|
---|
[bf847d6d] | 79 | </listitem>
|
---|
| 80 | </itemizedlist>
|
---|
| 81 |
|
---|
| 82 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 83 |
|
---|
[4716d52] | 84 | <itemizedlist spacing="compact">
|
---|
[bf847d6d] | 85 | <title>Optional HTML Documentation</title>
|
---|
| 86 | <listitem>
|
---|
[181662f] | 87 | <para>
|
---|
| 88 | Download (HTTP): <ulink url="&python2htmldoc-download-http;"/>
|
---|
| 89 | </para>
|
---|
[bf847d6d] | 90 | </listitem>
|
---|
| 91 | <listitem>
|
---|
[181662f] | 92 | <para>
|
---|
| 93 | Download MD5 sum: &python2htmldoc-md5sum;
|
---|
| 94 | </para>
|
---|
[bf847d6d] | 95 | </listitem>
|
---|
| 96 | <listitem>
|
---|
[181662f] | 97 | <para>
|
---|
| 98 | Download size: &python2htmldoc-size;
|
---|
| 99 | </para>
|
---|
[bf847d6d] | 100 | </listitem>
|
---|
| 101 | </itemizedlist>
|
---|
| 102 |
|
---|
[03d30cf] | 103 | <bridgehead renderas="sect3">Python 2 Dependencies</bridgehead>
|
---|
[bf847d6d] | 104 |
|
---|
[82fac2c] | 105 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 106 | <para role="recommended">
|
---|
[9ef15dba] | 107 | <xref linkend="expat"/>,
|
---|
| 108 | <xref linkend="libffi"/> and
|
---|
| 109 | <xref linkend="pkgconfig"/>
|
---|
[82fac2c] | 110 | </para>
|
---|
| 111 |
|
---|
[bf847d6d] | 112 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[181662f] | 113 | <para role="optional">
|
---|
[03d30cf] | 114 | <xref linkend="bluez"/>
|
---|
[82fac2c] | 115 | </para>
|
---|
| 116 |
|
---|
| 117 | <bridgehead renderas="sect4">Optional (For Additional Modules)</bridgehead>
|
---|
| 118 | <para role="optional">
|
---|
| 119 | <xref linkend="db"/>,
|
---|
[181662f] | 120 | <xref linkend="openssl"/>,
|
---|
[82fac2c] | 121 | <xref linkend="sqlite"/> and
|
---|
| 122 | <xref linkend="tk"/>
|
---|
[181662f] | 123 | </para>
|
---|
| 124 |
|
---|
| 125 | <para condition="html" role="usernotes">
|
---|
| 126 | User Notes: <ulink url="&blfs-wiki;/Python"/>
|
---|
| 127 | </para>
|
---|
[bf847d6d] | 128 | </sect2>
|
---|
| 129 |
|
---|
| 130 | <sect2 role="installation">
|
---|
[03d30cf] | 131 | <title>Installation of Python 2</title>
|
---|
[bf847d6d] | 132 |
|
---|
[181662f] | 133 | <para>
|
---|
[03d30cf] | 134 | Install <application>Python 2</application> by running the following
|
---|
[181662f] | 135 | commands:
|
---|
| 136 | </para>
|
---|
[bf847d6d] | 137 |
|
---|
[4af4be4] | 138 | <screen><userinput>./configure --prefix=/usr \
|
---|
[82fac2c] | 139 | --enable-shared \
|
---|
| 140 | --with-system-expat \
|
---|
| 141 | --with-system-ffi \
|
---|
| 142 | --enable-unicode=ucs4 &&
|
---|
[bf847d6d] | 143 | make</userinput></screen>
|
---|
| 144 |
|
---|
[181662f] | 145 | <para>
|
---|
| 146 | To test the results, issue: <command>make test</command>.
|
---|
| 147 | </para>
|
---|
[bf847d6d] | 148 |
|
---|
[181662f] | 149 | <para>
|
---|
| 150 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 151 | </para>
|
---|
[bf847d6d] | 152 |
|
---|
[7224506] | 153 | <screen role="root"><userinput>make install &&
|
---|
| 154 | chmod -v 755 /usr/lib/libpython&python2-majorver;.so.1.0</userinput></screen>
|
---|
[bf847d6d] | 155 |
|
---|
[181662f] | 156 | <para>
|
---|
[03d30cf] | 157 | If you have downloaded the preformatted documentation from
|
---|
| 158 | <ulink url="http://docs.python.org/download.html"/>, install it
|
---|
| 159 | as the <systemitem class="username">root</systemitem> user:
|
---|
[181662f] | 160 | </para>
|
---|
| 161 |
|
---|
[23d3543c] | 162 | <screen role="root"><userinput>install -v -dm755 /usr/share/doc/python-&python2-version; &&
|
---|
[03d30cf] | 163 | tar --strip-components=1 -C /usr/share/doc/python-&python2-version; \
|
---|
[f695fc0] | 164 | -xvf ../python-&python2-version;-docs-html.tar.bz2 &&
|
---|
[03d30cf] | 165 | find /usr/share/doc/python-&python2-version; -type d -exec chmod 0755 {} \; &&
|
---|
| 166 | find /usr/share/doc/python-&python2-version; -type f -exec chmod 0644 {} \;</userinput></screen>
|
---|
[bf847d6d] | 167 | </sect2>
|
---|
| 168 |
|
---|
| 169 | <sect2 role="commands">
|
---|
| 170 | <title>Command Explanations</title>
|
---|
| 171 |
|
---|
[82fac2c] | 172 | <para>
|
---|
| 173 | <option>--with-system-expat</option>: This switch enables linking against
|
---|
| 174 | system version of <application>Expat</application>. Remove if you have
|
---|
[03d30cf] | 175 | not installed <xref linkend="expat"/>.
|
---|
[82fac2c] | 176 | </para>
|
---|
| 177 |
|
---|
| 178 | <para>
|
---|
| 179 | <option>--with-system-ffi</option>: This switch enables linking against
|
---|
| 180 | system version of <application>libffi</application>. Remove if you have
|
---|
[03d30cf] | 181 | not installed <xref linkend="libffi"/>.
|
---|
[82fac2c] | 182 | </para>
|
---|
| 183 |
|
---|
| 184 | <para>
|
---|
| 185 | <parameter>--enable-unicode=ucs4</parameter>: This switch enables
|
---|
| 186 | 32bit Unicode support in <application>Python</application>.
|
---|
| 187 | </para>
|
---|
| 188 |
|
---|
| 189 | <para>
|
---|
| 190 | <parameter>--with-dbmliborder=bdb:gdbm:ndbm</parameter>: Use this switch
|
---|
[0d7900a] | 191 | if you want to build <application>Python</application> DBM Module
|
---|
[82fac2c] | 192 | against <application>Berkeley DB</application> instead of
|
---|
| 193 | <application>GDBM</application>.
|
---|
| 194 | </para>
|
---|
| 195 |
|
---|
[181662f] | 196 | <para>
|
---|
[0d7900a] | 197 | <command>chmod ...</command>: Fix permissions for libraries to be
|
---|
[181662f] | 198 | consistent with other libraries.
|
---|
| 199 | </para>
|
---|
[82fac2c] | 200 |
|
---|
[bf847d6d] | 201 | </sect2>
|
---|
| 202 |
|
---|
| 203 | <sect2 role="configuration">
|
---|
| 204 | <title>Configuring Python 2</title>
|
---|
| 205 |
|
---|
[181662f] | 206 | <para>
|
---|
| 207 | In order for <command>python</command> to find the installed
|
---|
| 208 | documentation, you must add the following environment variable to
|
---|
| 209 | individual user's or the system's profile:
|
---|
| 210 | </para>
|
---|
[bf847d6d] | 211 |
|
---|
[03d30cf] | 212 | <screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-&python2-version;</userinput></screen>
|
---|
[82fac2c] | 213 |
|
---|
[bf847d6d] | 214 | </sect2>
|
---|
| 215 |
|
---|
| 216 | <sect2 role="content">
|
---|
| 217 | <title>Contents</title>
|
---|
| 218 |
|
---|
| 219 | <segmentedlist>
|
---|
| 220 | <segtitle>Installed Programs</segtitle>
|
---|
[03d30cf] | 221 | <segtitle>Installed Library</segtitle>
|
---|
[bf847d6d] | 222 | <segtitle>Installed Directories</segtitle>
|
---|
| 223 |
|
---|
| 224 | <seglistitem>
|
---|
[181662f] | 225 | <seg>
|
---|
[03d30cf] | 226 | 2to3, pydoc, python, python-config, python2, python2-config,
|
---|
| 227 | python&python2-majorver;, python&python2-majorver;-config,
|
---|
| 228 | smtpd.py, and optionally if <application>Tk</application>
|
---|
| 229 | is installed, idle
|
---|
[181662f] | 230 | </seg>
|
---|
| 231 | <seg>
|
---|
[03d30cf] | 232 | libpython&python2-majorver;.so
|
---|
[181662f] | 233 | </seg>
|
---|
| 234 | <seg>
|
---|
| 235 | /usr/include/python&python2-majorver;,
|
---|
| 236 | /usr/lib/python&python2-majorver;, and
|
---|
| 237 | /usr/share/doc/python-&python2-version;</seg>
|
---|
[bf847d6d] | 238 | </seglistitem>
|
---|
| 239 | </segmentedlist>
|
---|
| 240 |
|
---|
| 241 | <variablelist>
|
---|
| 242 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 243 | <?dbfo list-presentation="list"?>
|
---|
| 244 | <?dbhtml list-presentation="table"?>
|
---|
| 245 |
|
---|
[62f9a8e] | 246 | <varlistentry id="python2-2to3">
|
---|
| 247 | <term><command>2to3</command></term>
|
---|
| 248 | <listitem>
|
---|
| 249 | <para>
|
---|
| 250 | is a <application>Python</application> program that reads
|
---|
| 251 | <application>Python 2.x</application> source code and applies a series of
|
---|
| 252 | fixers to transform it into valid <application>Python 3.x</application>
|
---|
| 253 | code.
|
---|
| 254 | </para>
|
---|
| 255 | <indexterm zone="python2 python2-2to3">
|
---|
| 256 | <primary sortas="b-2to3">2to3</primary>
|
---|
| 257 | </indexterm>
|
---|
| 258 | </listitem>
|
---|
| 259 | </varlistentry>
|
---|
| 260 |
|
---|
[03d30cf] | 261 | <varlistentry id="idle">
|
---|
[bf847d6d] | 262 | <term><command>idle</command></term>
|
---|
| 263 | <listitem>
|
---|
[181662f] | 264 | <para>
|
---|
| 265 | is a wrapper script that opens a <application>Python</application>
|
---|
| 266 | aware GUI editor.
|
---|
| 267 | </para>
|
---|
[03d30cf] | 268 | <indexterm zone="python2 idle">
|
---|
| 269 | <primary sortas="b-idle">idle</primary>
|
---|
[bf847d6d] | 270 | </indexterm>
|
---|
| 271 | </listitem>
|
---|
| 272 | </varlistentry>
|
---|
| 273 |
|
---|
| 274 | <varlistentry id="pydoc2">
|
---|
| 275 | <term><command>pydoc</command></term>
|
---|
| 276 | <listitem>
|
---|
[181662f] | 277 | <para>
|
---|
| 278 | is the <application>Python</application> documentation tool.
|
---|
| 279 | </para>
|
---|
[4716d52] | 280 | <indexterm zone="python2 pydoc2">
|
---|
[bf847d6d] | 281 | <primary sortas="b-pydoc2">pydoc</primary>
|
---|
| 282 | </indexterm>
|
---|
| 283 | </listitem>
|
---|
| 284 | </varlistentry>
|
---|
| 285 |
|
---|
[181662f] | 286 | <varlistentry id="python">
|
---|
[bf847d6d] | 287 | <term><command>python</command></term>
|
---|
| 288 | <listitem>
|
---|
[181662f] | 289 | <para>
|
---|
| 290 | is an interpreted, interactive, object-oriented programming
|
---|
| 291 | language.
|
---|
| 292 | </para>
|
---|
| 293 | <indexterm zone="python2 python">
|
---|
[4716d52] | 294 | <primary sortas="b-python2">python</primary>
|
---|
[bf847d6d] | 295 | </indexterm>
|
---|
| 296 | </listitem>
|
---|
| 297 | </varlistentry>
|
---|
| 298 |
|
---|
| 299 | <varlistentry id="python2-ver">
|
---|
| 300 | <term><command>python&python2-majorver;</command></term>
|
---|
| 301 | <listitem>
|
---|
[181662f] | 302 | <para>
|
---|
| 303 | is a version-specific name for the <command>python</command>
|
---|
| 304 | program.
|
---|
| 305 | </para>
|
---|
[4716d52] | 306 | <indexterm zone="python2 python2-ver">
|
---|
[b88be39] | 307 | <primary sortas="b-python&python2-majorver;">python&python2-majorver;</primary>
|
---|
[bf847d6d] | 308 | </indexterm>
|
---|
| 309 | </listitem>
|
---|
| 310 | </varlistentry>
|
---|
| 311 |
|
---|
[03d30cf] | 312 | <varlistentry id="smtpd.py">
|
---|
[bf847d6d] | 313 | <term><command>smtpd.py</command></term>
|
---|
| 314 | <listitem>
|
---|
[181662f] | 315 | <para>
|
---|
| 316 | is an SMTP proxy implemented in <application>Python</application>.
|
---|
| 317 | </para>
|
---|
[03d30cf] | 318 | <indexterm zone="python2 smtpd.py">
|
---|
| 319 | <primary sortas="b-smtpd.py">smtpd.py</primary>
|
---|
[bf847d6d] | 320 | </indexterm>
|
---|
| 321 | </listitem>
|
---|
| 322 | </varlistentry>
|
---|
[82fac2c] | 323 |
|
---|
[bf847d6d] | 324 | </variablelist>
|
---|
[82fac2c] | 325 |
|
---|
[bf847d6d] | 326 | </sect2>
|
---|
[82fac2c] | 327 |
|
---|
[bf847d6d] | 328 | </sect1>
|
---|