| 1 | \chapter{Introduction}
|
|---|
| 2 | \label{intro}
|
|---|
| 3 |
|
|---|
| 4 | The ``Python library'' contains several different kinds of components.
|
|---|
| 5 |
|
|---|
| 6 | It contains data types that would normally be considered part of the
|
|---|
| 7 | ``core'' of a language, such as numbers and lists. For these types,
|
|---|
| 8 | the Python language core defines the form of literals and places some
|
|---|
| 9 | constraints on their semantics, but does not fully define the
|
|---|
| 10 | semantics. (On the other hand, the language core does define
|
|---|
| 11 | syntactic properties like the spelling and priorities of operators.)
|
|---|
| 12 |
|
|---|
| 13 | The library also contains built-in functions and exceptions ---
|
|---|
| 14 | objects that can be used by all Python code without the need of an
|
|---|
| 15 | \keyword{import} statement. Some of these are defined by the core
|
|---|
| 16 | language, but many are not essential for the core semantics and are
|
|---|
| 17 | only described here.
|
|---|
| 18 |
|
|---|
| 19 | The bulk of the library, however, consists of a collection of modules.
|
|---|
| 20 | There are many ways to dissect this collection. Some modules are
|
|---|
| 21 | written in C and built in to the Python interpreter; others are
|
|---|
| 22 | written in Python and imported in source form. Some modules provide
|
|---|
| 23 | interfaces that are highly specific to Python, like printing a stack
|
|---|
| 24 | trace; some provide interfaces that are specific to particular
|
|---|
| 25 | operating systems, such as access to specific hardware; others provide
|
|---|
| 26 | interfaces that are
|
|---|
| 27 | specific to a particular application domain, like the World Wide Web.
|
|---|
| 28 | Some modules are available in all versions and ports of Python; others
|
|---|
| 29 | are only available when the underlying system supports or requires
|
|---|
| 30 | them; yet others are available only when a particular configuration
|
|---|
| 31 | option was chosen at the time when Python was compiled and installed.
|
|---|
| 32 |
|
|---|
| 33 | This manual is organized ``from the inside out:'' it first describes
|
|---|
| 34 | the built-in data types, then the built-in functions and exceptions,
|
|---|
| 35 | and finally the modules, grouped in chapters of related modules. The
|
|---|
| 36 | ordering of the chapters as well as the ordering of the modules within
|
|---|
| 37 | each chapter is roughly from most relevant to least important.
|
|---|
| 38 |
|
|---|
| 39 | This means that if you start reading this manual from the start, and
|
|---|
| 40 | skip to the next chapter when you get bored, you will get a reasonable
|
|---|
| 41 | overview of the available modules and application areas that are
|
|---|
| 42 | supported by the Python library. Of course, you don't \emph{have} to
|
|---|
| 43 | read it like a novel --- you can also browse the table of contents (in
|
|---|
| 44 | front of the manual), or look for a specific function, module or term
|
|---|
| 45 | in the index (in the back). And finally, if you enjoy learning about
|
|---|
| 46 | random subjects, you choose a random page number (see module
|
|---|
| 47 | \refmodule{random}) and read a section or two. Regardless of the
|
|---|
| 48 | order in which you read the sections of this manual, it helps to start
|
|---|
| 49 | with chapter \ref{builtin}, ``Built-in Types, Exceptions and
|
|---|
| 50 | Functions,'' as the remainder of the manual assumes familiarity with
|
|---|
| 51 | this material.
|
|---|
| 52 |
|
|---|
| 53 | Let the show begin!
|
|---|