53 lines · 2.8 KB · TeX
RawDownload
\chapter{Introduction}\label{intro} The ``Python library'' contains several different kinds of components. It contains data types that would normally be considered part of the``core'' of a language, such as numbers and lists.  For these types,the Python language core defines the form of literals and places someconstraints on their semantics, but does not fully define thesemantics.  (On the other hand, the language core does definesyntactic properties like the spelling and priorities of operators.) The library also contains built-in functions and exceptions ---objects that can be used by all Python code without the need of an\keyword{import} statement.  Some of these are defined by the corelanguage, but many are not essential for the core semantics and areonly described here. The bulk of the library, however, consists of a collection of modules.There are many ways to dissect this collection.  Some modules arewritten in C and built in to the Python interpreter; others arewritten in Python and imported in source form.  Some modules provideinterfaces that are highly specific to Python, like printing a stacktrace; some provide interfaces that are specific to particularoperating systems, such as access to specific hardware; others provideinterfaces that arespecific to a particular application domain, like the World Wide Web.Some modules are available in all versions and ports of Python; othersare only available when the underlying system supports or requiresthem; yet others are available only when a particular configurationoption was chosen at the time when Python was compiled and installed. This manual is organized ``from the inside out:'' it first describesthe built-in data types, then the built-in functions and exceptions,and finally the modules, grouped in chapters of related modules.  Theordering of the chapters as well as the ordering of the modules withineach chapter is roughly from most relevant to least important. This means that if you start reading this manual from the start, andskip to the next chapter when you get bored, you will get a reasonableoverview of the available modules and application areas that aresupported by the Python library.  Of course, you don't \emph{have} toread it like a novel --- you can also browse the table of contents (infront of the manual), or look for a specific function, module or termin the index (in the back).  And finally, if you enjoy learning aboutrandom subjects, you choose a random page number (see module\refmodule{random}) and read a section or two.  Regardless of theorder in which you read the sections of this manual, it helps to start with chapter \ref{builtin}, ``Built-in Types, Exceptions andFunctions,'' as the remainder of the manual assumes familiarity withthis material. Let the show begin!