Preface
The Python programming language manages to reconcile many apparentcontradictions: its both elegant and pragmatic,simple and powerful, a high-level language thatdoesnt get in your way when you want to fiddle withbits and bytes, suitable for programming novices and great forexperts too.
This book is aimed at programmers with some previous exposure toPython, as well as experienced programmers coming to Python for thefirst time from other programming languages. The book is a quickreference to Python itself, the most important parts of its vaststandard library, and some of the most popular and useful third-partymodules, covering a range of applications including web and networkprogramming, GUIs, XML handling, database interactions, andhigh-speed numeric computing. It focuses on Pythonscross-platform capabilities and covers the basics of extending Pythonand embedding it in other applications, using either C or Java.
How This Book Is Organized
This book has five parts, as follows:
,
Getting Started with Pythoncovers the general characteristics ofthe Python language and its implementations, and discusses where toget help and information.
explains how to obtain and installPython.
covers the Python interpreter program,its command-line options, and its use for running Python programs andin interactive sessions. The chapter also mentions text editors thatare particularly suitable for editing Python programs, and examinessome full-fledged integrated development environments, includingIDLE, which comes free with standard Python.
,
Core Python Language and Built-inscovers Python syntax, built-in datatypes, expressions, statements, and how to write and call functions.
explains object-oriented programming inPython.
covers how to deal with errors andabnormal conditions in Python programs.
covers the ways in which Python letsyou group code into modules and packages, and how to define andimport modules.
is a reference to built-in data typesand functions, and some of the most fundamental modules in thestandard Python library.
covers Pythonspowerful string-processing facilities, including regular expressions.
,
Python Library and Extension Modulesexplains how to deal with files andtext processing using built-in Python file objects, modules fromPythons standard library, and platform-specificextensions for rich text I/O.
introduces Pythonsserialization and persistence mechanisms, as well asPythons interfaces to DBM databases and relational(SQL-based) databases.
covers how to deal with times and datesin Python, using the standard library and popular extensions.
explains how to achieve advancedexecution control in Python, including execution of dynamicallygenerated code, restricted execution environments, and control ofgarbage collection.
covers Pythonsfunctionality for concurrent execution, both via multiple threadsrunning within one process and via multiple processes running on asingle machine.
shows Pythonsfeatures for numeric computations, both in standard library modulesand in the popular extension package calledNumeric
.
explains how to develop graphical userinterfaces in Python with the Tkinter package included with thestandard Python distribution, and mentions other alternative PythonGUI frameworks.
deals with Python tools and approachesthat help ensure your programs do what theyre meantto do, find and correct errors in your programs, and check andenhance performance.
,
Network and Web Programmingcovers many modules inPythons standard library that help you writenetwork client programs.
explains Pythonsinterfaces to low-level network mechanisms (sockets), standard Pythonlibrary modules that help you write network server programs, andasynchronous (event-driven) network programming with standard modulesand popular extensions.
covers the basics of CGI programmingand how to perform CGI programming in Python with standard Pythonlibrary modules. The chapter also mentions alternatives to CGIprogramming for server-side web programming through Pythonextensions.
shows how to process email and othernetwork-structured and encoded documents in Python.
covers Python library modules that letyou process and generate HTML documents.
covers Python library modules andpopular extensions that let you process, modify, and generate XMLdocuments.
,
Extending and Embeddingshows how to code Python extensionmodules using C and other classic compiled languages, and how toembed Python in applications coded in such languages.
shows how to use Java classes from theJython implementation of Python, and how to embed Jython inapplications coded in Java.
covers the tools that let you packagePython extensions, modules, and applications for distribution.
Conventions Used in This Book
The following conventions are used throughout this book.
Reference Conventions
In the function/method reference entries, when feasible, eachoptional parameter is shown with a default value using the Pythonsyntaxname
=
value
.Built-in functions need not accept named parameters, so parameternames are not significant. Some optional parameters are bestexplained in terms of their presence or absence, rather than throughdefault values. In such cases, a parameter is indicated as beingoptional by enclosing it in brackets ([ ]
). Whenmore than one argument is optional, the brackets are nested.
Typographic Conventions
Italic
Used for filenames, program names, URLs, and to introduce new terms.
Constant
Width
Used for all code examples, as well as for commands and all itemsthat appear in code, including keywords, methods, functions, classes,and modules.
Constant
Width
Italic
Used to show text that can be replaced with user-supplied values incode examples.
Constant Width Bold
Used for commands that must be typed on the command line, andoccasionally for emphasis in code examples or to indicate codeoutput.
How to Contact Us
We have tested and verified the information in this book to the bestof our ability, but you may find that features have changed (or eventhat we have made mistakes!). Please let us know about any errors youfind, as well as your suggestions for future editions, by writing to:
OReilly & Associates |
1005 Gravenstein Highway North |
Sebastopol, CA 95472 |
(800) 928-9938 (in the United States or Canada) |
(707) 829-0515 (international or local) |
(707) 829-0104 (fax) |
There is a web page for this book, which lists errata, examples, andany additional information. You can access this page at:
http://www.oreilly.com/catalog/pythonian/ |