Learning Python, 3E - Ascher, Lutz (O'reilly, 2008).pdf

(2699 KB) Pobierz
THIRD EDITION
Learning Python
Mark Lutz
Beijing
Cambridge
Farnham
Köln
Paris
Sebastopol
Taipei
Tokyo
Learning Python, Third Edition
by Mark Lutz
Copyright © 2008 O’Reilly Media, Inc. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions
are also available for most titles (safari.oreilly.com). For more information, contact our
corporate/institutional sales department: (800) 998-9938 or
corporate@oreilly.com.
Editor:
Tatiana Apandi
Production Editor:
Sumita Mukherji
Copyeditor:
Rachel Head
Proofreader:
Sumita Mukherji
Printing History:
March 1999:
December 2003:
October 2007:
First Edition.
Second Edition.
Third Edition.
Indexer:
Julie Hawks
Cover Designer:
Karen Montgomery
Interior Designer:
David Futato
Illustrator:
Robert Romano
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of
O’Reilly Media, Inc.,
Learning Python,
the image of a wood rat, and related trade dress are trademarks
of O’Reilly Media, Inc.
Java
is a trademark of Sun Microsystems, Inc. .NET is a registered trademark of Microsoft
Corporation.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a
trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and author assume
no responsibility for errors or omissions, or for damages resulting from the use of the information
contained herein.
This book uses RepKover
a durable and flexible lay-flat binding.
,
ISBN-10: 0-596-51398-4
ISBN-13: 978-0-596-51398-6
[M]
To Vera.
You are my life.
Table of Contents
Preface
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xxix
Part I.
Getting Started
3
5
5
6
7
8
9
9
9
10
10
11
11
11
12
12
12
13
13
14
15
vii
1. A Python Q&A Session
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3
Why Do People Use Python?
Software Quality
Developer Productivity
Is Python a “Scripting Language”?
OK, but What’s the Downside?
Who Uses Python Today?
What Can I Do with Python?
Systems Programming
GUIs
Internet Scripting
Component Integration
Database Programming
Rapid Prototyping
Numeric and Scientific Programming
Gaming, Images, AI, XML, Robots, and More
What Are Python’s Technical Strengths?
It’s Object Oriented
It’s Free
It’s Portable
It’s Powerful
It’s Mixable
Zgłoś jeśli naruszono regulamin