Expert Python Programming.pdf

(5355 KB) Pobierz
Expert Python Programming
Learn best practices to designing, coding, and
distributing your Python software
Tarek Ziadé
BIRMINGHAM - MUMBAI
Expert Python Programming
Copyright © 2008 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of
the information presented. However, the information contained in this book is sold
without warranty, either express or implied. Neither the author, Packt Publishing,
nor its dealers or distributors will be held liable for any damages caused or alleged to
be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
First published: September 2008
Production Reference: 1110908
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-847194-94-7
www.packtpub.com
Cover Image by Javier BarrXa C. (
jbarriac@yahoo.com
)
Credits
Author
Tarek Ziadé
Reviewers
Shannon -jj Behrens
Paul Kennedy
Wendy Langer
Senior Acquisition Editor
Douglas Paterson
Development Editor
Ved Prakash Jha
Technical Editor
Siddharth Mangarole
Cover Work
Copy Editor
Sneha Kulkarni
Editorial Team Leader
Mithil Kulkarni
Aparna Bhagat
Production Coordinators
Aparna Bhagat
Rajni Thorat
Proofreader
Chris Smith
Indexer
Rekha Nair
Project Manager
Abhijeet Deobhakta
Project Coordinator
Patricia Weir
Foreword
Python has come a long way.
There was a time when companies would call me crazy when I insisted on using
Python. These days, there simply aren't enough Python coders to go around. Major
companies such as Google, YouTube, VMware, and DreamWorks are in a constant
scramble to snatch up all the good Python talent they can find.
Python used to lag behind Perl because Perl had CPAN. These days,
setuptools
and PyPI have led to an explosion of readily available, high-quality, third-party
Python libraries. Python also used to lag behind Java Servlets and Ruby on Rails
because there was no standard API for interacting with web servers. These days, the
Web Server Gateway Interface (WSGI) has led to a renaissance in the Python web
world. Thanks to Google App Engine, I think we'll see even more.
Python seems to attract programmers who are highly opinionated and have a real
taste for elegance. Very few people become Python programmers because it's what
they learned in college, or because it's what all the big companies are using. Rather,
people are drawn to Python when they discover its intrinsic beauty. Because of this,
there are a surprising number of Python books. I don't have the statistics to prove it,
but it seems to me that Python has a higher ratio of books to programmers than any
other language. However, historically, there haven't been enough advanced Python
books. That's about to change.
This book presents an interesting list of topics. It covers a range of Python features
and how to use them in unexpected ways. It also covers a selection of interesting
third-party libraries and tools. Along the way, agile programming with Python
tools and libraries is covered. This includes test-driven development with
Nose
,
document-driven development with
doctest
, source control with Mercurial,
continuous integration with
Buildbot
, and project management with Trac. Finally,
it covers more traditional topics such as profiling, optimization, and design patterns
such as Alex Martelli's infamous Borg approach to Singletons.
Zgłoś jeśli naruszono regulamin