Programming in Python 3: A Complete Introduction to the Python Language (Developer's Library Series)

( 7 )
Marketplace (New and Used)
Paperback
from
$8.35
$44.99 List Price (Save 81%)
Usually ships within 1-2 business days
All (11)  
Used (7)  
New (4)  
Close
Sort by
Page 1 of 2
Showing 1 – 10 of 11 (2 pages)
$8.35
(Save 81%)
Seller since 2008

Feedback rating:

(893)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

Good
Every heavytail order includes with a sweet! We carefully hand cleans and reinspects each and every item we ship. Our quality control process ensures items to be in the condition ... described or better. Heavytail is determined to earn your repeat business through old fashioned customer service. Read more Show Less

Ships from: Evanston, IL

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$12.00
(Save 73%)
Seller since 2005

Feedback rating:

(212)

Condition: Good
2008 Paperback Good A 1" x 2" stain at the bottom front corner does not carry onto any pages. Otherwise, a clean, tight copy.

Ships from: State College, PA

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$29.95
(Save 33%)
Seller since 2012

Feedback rating:

(5)

Condition: Good

Ships from: Lookout Mountain, GA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Express, 48 States
  • Express (AK, HI)
$31.45
(Save 30%)
Seller since 2011

Feedback rating:

(0)

Condition: Good
2008-12-26 Paperback Good

Ships from: Lookout Mountain, GA

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$44.47
(Save 1%)
Seller since 2006

Feedback rating:

(9928)

Condition: Good
Standard used condition.

Ships from: Baltimore, MD

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$47.01
Seller since 2007

Feedback rating:

(322)

Condition: New
0137129297 NEW * GIFT QUALITY

Ships from: BALDWIN, NY

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
$78.61
Seller since 2007

Feedback rating:

(2312)

Condition: New
Buy with confidence. Excellent Customer Service & Return policy.

Ships from: Richmond, TX

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
$81.04
Seller since 2011

Feedback rating:

(507)

Condition: Very Good
2008 Paperback Very good

Ships from: MIAMI, FL

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$86.47
Seller since 2010

Feedback rating:

(674)

Condition: Very Good
2008 Paperback Very good Great customer service. You will be happy!

Ships from: Schenectady, NY

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$120.52
Seller since 2011

Feedback rating:

(507)

Condition: New
2008 Paperback New

Ships from: MIAMI, FL

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
Page 1 of 2
Showing 1 – 10 of 11 (2 pages)
Close
Sort by
NOOK Book (eBook)
$23.39
BN.com price
$35.99 List Price (Save 35%)

Available on NOOK devices and apps

  • Nook Devices
  • NOOK
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for iPad
  • NOOK for iPhone
  • NOOK for Android
  • NOOK for Android (Tablet)
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK Study
  • NOOK for PC
  • NOOK for Mac

Need a NOOK? Explore Now

Overview

Python 3 is the best version of the language yet: It is more powerful, convenient, consistent, and expressive than ever before. Now, leading Python programmer Mark Summerfield demonstrates how to write code that takes full advantage of Python 3’s features and idioms. The first book written from a completely “Python 3” viewpoint, Programming in Python 3 brings together all the knowledge you need to write any program, use any standard or third-party Python 3 library, and create new library modules of your own.

Summerfield draws on his many years of Python experience to share deep insights into Python 3 development you won’t find anywhere else. He begins by...

See more details below

Overview

Python 3 is the best version of the language yet: It is more powerful, convenient, consistent, and expressive than ever before. Now, leading Python programmer Mark Summerfield demonstrates how to write code that takes full advantage of Python 3’s features and idioms. The first book written from a completely “Python 3” viewpoint, Programming in Python 3 brings together all the knowledge you need to write any program, use any standard or third-party Python 3 library, and create new library modules of your own.

Summerfield draws on his many years of Python experience to share deep insights into Python 3 development you won’t find anywhere else. He begins by illuminating Python’s “beautiful heart”: the eight key elements of Python you need to write robust, high-performance programs. Building on these core elements, he introduces new topics designed to strengthen your practical expertise–one concept and hands-on example at a time. This book’s coverage includes

  • Developing in Python using procedural, object-oriented, and functional programming paradigms
  • Creating custom packages and modules
  • Writing and reading binary, text, and XML files, including optional compression, random access, and text and XML parsing
  • Leveraging advanced data types, collections, control structures, and functions
  • Spreading program workloads across multiple processes and threads
  • Programming SQL databases and key-value DBM files
  • Utilizing Python’s regular expression mini-language and module
  • Building usable, efficient, GUI-based applications
  • Advanced programming techniques, including generators, function and class decorators, context managers, descriptors, abstract base classes, metaclasses, and more

Programming in Python 3serves as both tutorial and language reference, and it is accompanied by extensive downloadable example code–all of it tested with the final version of Python 3 on Windows, Linux, and Mac OS X.

Product Details

  • ISBN-13: 9780137129294
  • Publisher: Addison-Wesley
  • Publication date: 1/9/2009
  • Pages: 526
  • Series: Developer's Library
  • Product dimensions: 6.90 (w) x 8.90 (h) x 1.40 (d)

Meet the Author

Mark Summerfield, owner of Qtrac Ltd., is an independent trainer, consultant, technical editor, and writer specializing in Python, C++, Qt, and PyQt. His books include Rapid GUI Programming with Python and Qt: The Definitive Guide to PyQt Programming (Addison-Wesley, 2008) and, cowritten with Jasmin Blanchette, C++ GUI Programming with Qt 4 (Addison-Wesley, 2006). As Trolltech’s documentation manager, Mark founded and edited Trolltech’s technical journal, Qt Quarterly.

Read an Excerpt

Introduction

Python is probably the easiest-to-learn and nicest-to-use programming language in widespread use. Python code is clear to read and write, and is concise without being cryptic. Python is a very expressive language, which means that we can usually write far fewer lines of Python code than would be required for an equivalent application written in, say, C++ or Java.

Python is a cross-platform language: In general, the same Python program can be run on Windows and Unix-like systems such as Linux, BSD, and Mac OS X, simply by copying the file or files that make up the program to the target machine, with no “building” or compiling necessary. It is possible to create Python programs that use platform-specific functionality, but this is rarely necessary since almost all of Python’s standard library and most third-party libraries are fully and transparently cross-platform.

One of Python’s great strengths is that it comes with a very complete standard library—this allows us to do such things as download a file from the Internet, unpack a compressed archive file, or create a Web server, all with just one or a few lines of code. And in addition to the standard library, thousands of third-party libraries are available, some providing more powerful and sophisticated facilities than the standard library—for example, the Twisted networking library and the NumPy numeric library—while others provide functionality that is too specialized to be included in the standard library—for example, the SimPy simulation package. Most of the third-party libraries are available from the Python Package Index, pypi.python.org/pypi.

Python can be used to program in procedural, object-oriented, and to a lesser extent, in functional style, although at heart Python is an object-oriented language. This book shows how to write both procedural and object-oriented programs, and also teaches Python¿s functional programming features.

The purpose of this book is to show you how to write Python programs in good idiomatic Python 3 style, and to be a useful reference for the Python 3 language after the initial reading. Although Python 3 is an evolutionary rather than revolutionary advance on Python 2, some older practices are no longer appropriate or necessary in Python 3, and new practices have been introduced to take advantage of Python 3 features. Python 3 is a better language than Python 2—it builds on the many years of experience with Python 2 and adds lots of new features (and omits Python 2’s misfeatures), to make it even more of a pleasure to use than Python 2, as well as more convenient, easier, and more consistent.

The book’s aim is to teach the Python language, and although many of the standard Python libraries are used, not all of them are. This is not a problem, because once you have read the book, you will have enough Python knowledge to be able to make use of any of the standard libraries, or any third-party Python library, and be able to create library modules of your own.

The book is designed to be useful to several different audiences, including self-taught and hobbyist programmers, students, scientists, engineers and others who need to program as part of their work, and of course, computing professionals and computer scientists. To be of use to such a wide range of people without boring the knowledgeable or losing the less-experienced, the book assumes at least some programming experience (in any language). In particular, it assumes a basic knowledge of data types (such as numbers and strings), collection data types (such as sets and lists), control structures (such as if and while statements), and functions. In addition, some examples and exercises assume a basic knowledge of HTML markup, and some of the more specialized chapters at the end assume a basic knowledge of their subject area; for example, the databases chapter assumes a basic knowledge of SQL.

The book is structured in such a way as to make you as productive as possible as quickly as possible. By the end of the first chapter you will be able to write small but useful Python programs. Each successive chapter introduces new topics, and often both broadens and deepens the coverage of topics introduced in earlier chapters. This means that if you read the chapters in sequence, you can stop at any point and you’ll be able to write complete programs with what you have learned up to that point, and then, of course, resume reading to learn more advanced and sophisticated techniques when you are ready. For this reason, some topics are introduced in one chapter, and then are explored further in one or more later chapters.

Two key problems arise when teaching a new programming language. The first is that sometimes when it is necessary to teach one particular concept, that concept depends on another concept, which in turn depends either directly or indirectly on the first. The second is that, at the beginning, the reader may know little or nothing of the language, so it is very difficult to present interesting or useful examples and exercises. In this book, we seek to solve both of these problems, first by assuming some prior programming experience, and second by presenting Python’s “beautiful heart” in Chapter 1—eight key pieces of Python that are sufficient on their own to write decent programs. One consequence of this approach is that in the early chapters some of the examples are a bit artificial in style since they use only what has been taught up to the point where they are presented; this effect diminishes chapter by chapter, until by the end of Chapter 7, all the examples are written in completely natural and idiomatic Python 3 style.

The book’s approach is wholly practical, and you are encouraged to try out the examples and exercises for yourself to get hands-on experience. Wherever possible, small but complete programs are used as examples, to provide realistic use cases. The examples and excercise solutions are available online at www.qtrac.eu/py3book.html—all of them have been tested with Python 3.0 final on Windows and Unix.

The Structure of the Book

Chapter 1 presents eight key pieces of Python that are sufficient for writing complete programs. It also describes some of the Python programming environments that are available, and presents two tiny example programs both built using the eight key pieces of Python covered earlier in the chapter.

Chapters 2 through 5 introduce Python’s procedural programming features, including its basic data types and collection data types, and many useful built-in functions and control structures, as well as very simple text file handling.

Chapter 5 shows how to create custom modules and packages and provides an overview of Python’s standard library so that you will have a good idea of the functionality that Python provides out of the box and can avoid reinventing the wheel.

Chapter 6 provides a thorough introduction to object-oriented programming with Python. All of the material on procedural programming that you learned in earlier chapters is still applicable, since object-oriented programming is built on procedural foundations—for example, making use of the same data types, collection data types, and control structures.

Chapter 7 covers writing and reading files. For binary files, the coverage includes compression and random access, and for text files, the coverage includes parsing manually and with regular expressions. This chapter also shows how to write and read

Chapter 8 revisits material covered in some earlier chapters, exploring many of Python’s more advanced features in the areas of data types and collection data types, control structures, functions, and object-oriented programming. This chapter also introduces many new functions, classes, and advanced techniques, including functional-style programming—the material it covers is both challenging and rewarding.

The remaining chapters cover other advanced topics. Chapter 9 shows techniques for spreading a program’s workload over multiple processes and over multiple threads. Chapter 10 shows how to write client/server applications using Python’s standard networking support. Chapter 11 covers database programming (both simple key-value “DBM” files, and SQL databases). Chapter 12 explains and illustrates Python’s regular expression mini-language and covers the regular expressions module, and Chapter 13 introduces GUI (Graphical User Interface) programming.

Most of the book’s chapters are quite long to keep all the related material together in one place for ease of reference. However, the chapters are broken down into sections, subsections, and sometimes subsubsections, so it is easy to read at a pace that suits you; for example, by reading one section or subsection at a time.

Table of Contents

Introduction 1

Ch. 1 Rapid Introduction to Procedural Programming 7

Ch. 2 Data Types 47

Ch. 3 Collection Data Types 99

Ch. 4 Control Structures and Functions 149

Ch. 5 Modules 185

Ch. 6 Object-Oriented Programming 223

Ch. 7 File Handling 277

Ch. 8 Advanced Programming Techniques 329

Ch. 9 Processes and Threading 395

Ch. 10 Networking 413

Ch. 11 Database Programming 431

Ch. 12 Regular Expressions 445

Ch. 13 Introduction to GUI Programming 467

Epilogue 493

Index 495

Preface

Introduction

Python is probably the easiest-to-learn and nicest-to-use programming language in widespread use. Python code is clear to read and write, and is concise without being cryptic. Python is a very expressive language, which means that we can usually write far fewer lines of Python code than would be required for an equivalent application written in, say, C++ or Java.

Python is a cross-platform language: In general, the same Python program can be run on Windows and Unix-like systems such as Linux, BSD, and Mac OS X, simply by copying the file or files that make up the program to the target machine, with no “building” or compiling necessary. It is possible to create Python programs that use platform-specific functionality, but this is rarely necessary since almost all of Python’s standard library and most third-party libraries are fully and transparently cross-platform.

One of Python’s great strengths is that it comes with a very complete standard library—this allows us to do such things as download a file from the Internet, unpack a compressed archive file, or create a Web server, all with just one or a few lines of code. And in addition to the standard library, thousands of third-party libraries are available, some providing more powerful and sophisticated facilities than the standard library—for example, the Twisted networking library and the NumPy numeric library—while others provide functionality that is too specialized to be included in the standard library—for example, the SimPy simulation package. Most of the third-party libraries are available from the Python Package Index,pypi.python.org/pypi.

Python can be used to program in procedural, object-oriented, and to a lesser extent, in functional style, although at heart Python is an object-oriented language. This book shows how to write both procedural and object-oriented programs, and also teaches Python¿s functional programming features.

The purpose of this book is to show you how to write Python programs in good idiomatic Python 3 style, and to be a useful reference for the Python 3 language after the initial reading. Although Python 3 is an evolutionary rather than revolutionary advance on Python 2, some older practices are no longer appropriate or necessary in Python 3, and new practices have been introduced to take advantage of Python 3 features. Python 3 is a better language than Python 2—it builds on the many years of experience with Python 2 and adds lots of new features (and omits Python 2’s misfeatures), to make it even more of a pleasure to use than Python 2, as well as more convenient, easier, and more consistent.

The book’s aim is to teach the Python language, and although many of the standard Python libraries are used, not all of them are. This is not a problem, because once you have read the book, you will have enough Python knowledge to be able to make use of any of the standard libraries, or any third-party Python library, and be able to create library modules of your own.

The book is designed to be useful to several different audiences, including self-taught and hobbyist programmers, students, scientists, engineers and others who need to program as part of their work, and of course, computing professionals and computer scientists. To be of use to such a wide range of people without boring the knowledgeable or losing the less-experienced, the book assumes at least some programming experience (in any language). In particular, it assumes a basic knowledge of data types (such as numbers and strings), collection data types (such as sets and lists), control structures (such as if and while statements), and functions. In addition, some examples and exercises assume a basic knowledge of HTML markup, and some of the more specialized chapters at the end assume a basic knowledge of their subject area; for example, the databases chapter assumes a basic knowledge of SQL.

The book is structured in such a way as to make you as productive as possible as quickly as possible. By the end of the first chapter you will be able to write small but useful Python programs. Each successive chapter introduces new topics, and often both broadens and deepens the coverage of topics introduced in earlier chapters. This means that if you read the chapters in sequence, you can stop at any point and you’ll be able to write complete programs with what you have learned up to that point, and then, of course, resume reading to learn more advanced and sophisticated techniques when you are ready. For this reason, some topics are introduced in one chapter, and then are explored further in one or more later chapters.

Two key problems arise when teaching a new programming language. The first is that sometimes when it is necessary to teach one particular concept, that concept depends on another concept, which in turn depends either directly or indirectly on the first. The second is that, at the beginning, the reader may know little or nothing of the language, so it is very difficult to present interesting or useful examples and exercises. In this book, we seek to solve both of these problems, first by assuming some prior programming experience, and second by presenting Python’s “beautiful heart” in Chapter 1—eight key pieces of Python that are sufficient on their own to write decent programs. One consequence of this approach is that in the early chapters some of the examples are a bit artificial in style since they use only what has been taught up to the point where they are presented; this effect diminishes chapter by chapter, until by the end of Chapter 7, all the examples are written in completely natural and idiomatic Python 3 style.

The book’s approach is wholly practical, and you are encouraged to try out the examples and exercises for yourself to get hands-on experience. Wherever possible, small but complete programs are used as examples, to provide realistic use cases. The examples and excercise solutions are available online at www.qtrac.eu/py3book.html—all of them have been tested with Python 3.0 final on Windows and Unix.The Structure of the Book

Chapter 1 presents eight key pieces of Python that are sufficient for writing complete programs. It also describes some of the Python programming environments that are available, and presents two tiny example programs both built using the eight key pieces of Python covered earlier in the chapter.

Chapters 2 through 5 introduce Python’s procedural programming features, including its basic data types and collection data types, and many useful built-in functions and control structures, as well as very simple text file handling.

Chapter 5 shows how to create custom modules and packages and provides an overview of Python’s standard library so that you will have a good idea of the functionality that Python provides out of the box and can avoid reinventing the wheel.

Chapter 6 provides a thorough introduction to object-oriented programming with Python. All of the material on procedural programming that you learned in earlier chapters is still applicable, since object-oriented programming is built on procedural foundations—for example, making use of the same data types, collection data types, and control structures.

Chapter 7 covers writing and reading files. For binary files, the coverage includes compression and random access, and for text files, the coverage includes parsing manually and with regular expressions. This chapter also shows how to write and read XML files, including using element trees, DOM (Document Object Model), and SAX (Simple API for XML).

Chapter 8 revisits material covered in some earlier chapters, exploring many of Python’s more advanced features in the areas of data types and collection data types, control structures, functions, and object-oriented programming. This chapter also introduces many new functions, classes, and advanced techniques, including functional-style programming—the material it covers is both challenging and rewarding.

The remaining chapters cover other advanced topics. Chapter 9 shows techniques for spreading a program’s workload over multiple processes and over multiple threads. Chapter 10 shows how to write client/server applications using Python’s standard networking support. Chapter 11 covers database programming (both simple key-value “DBM” files, and SQL databases). Chapter 12 explains and illustrates Python’s regular expression mini-language and covers the regular expressions module, and Chapter 13 introduces GUI (Graphical User Interface) programming.

Most of the book’s chapters are quite long to keep all the related material together in one place for ease of reference. However, the chapters are broken down into sections, subsections, and sometimes subsubsections, so it is easy to read at a pace that suits you; for example, by reading one section or subsection at a time.

Customer Reviews
Average Rating 4.5
( 7 )

Rating Distribution

  • ( 5 )
  • ( 1 )
  • ( 0 )
  • ( 1 )
  • ( 0 )
If you've bought this product, tell the world how you liked it.
Write a Review
Sort by: Showing 1 – 8 of 7 Customer Reviews
  • Posted July 11, 2009

    more from this reviewer

    Excellent

    This book does an excellent job of exposing the reader to Python 3. Mark Summerfield shows how to make testing easy with doctest. He also offers suggestions on how to write more maintainable code.

    As stated before, the margins feature cross-references. This is excellent if you want to use the book as a reference, it will point you to pages relevant to the current topic! The book has everything, from binary access files to regex to GUI programming.

    Summerfield does just the right amount of explaining topics for new programmers, and jumps into code discussion and exercises for experienced programmers. He also doesn't clutter the pages with repetitive code, so you are able to follow the topics easily. I definitely recommend this book for anyone moving from Python 2.5+ to Python 3, or anyone who is new to the language.

    Was this review helpful? Yes  No   Report this review
  • Posted May 23, 2009

    great python 3 book

    like most programming books this one covers the language

    what makes this book stand out are the following
    discusses the importance of conventions and idioms
    wants you to write good code, not just code that works
    uses the left margin well for cross references to relevant material
    uses the right margin to note subtle traps in the code
    put try loops in the code from the beginning
    it's ok for documentation to be longer than the code

    so after several decades of trying to be a professional coder
    whats not to like

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted May 2, 2009

    No text was provided for this review.

  • Anonymous

    Posted October 30, 2011

    No text was provided for this review.

  • Anonymous

    Posted February 14, 2009

    No text was provided for this review.

  • Anonymous

    Posted February 15, 2009

    No text was provided for this review.

  • Anonymous

    Posted December 12, 2009

    No text was provided for this review.

  • Anonymous

    Posted February 11, 2009

    No text was provided for this review.

Sort by: Showing 1 – 8 of 7 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)
500 character limit