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