Home > Store > Open Source > Python

larger cover

Add To My Wish List

Programming in Python 3: A Complete Introduction to the Python Language, 2nd Edition

Register your product to gain access to bonus material or receive a coupon.

  • Description
  • Extras
  • Reviews
  • Sample Content

Product Author Bios

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.

A Fully Revised Edition Featuring New Material on Coroutines, Debugging, Testing, Parsing, String Formatting, and More

 

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. Programming in Python 3, Second Edition, 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. Coverage includes

  • Developing in Python using procedural, objectoriented, 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
  • Debugging techniques–and using Test Driven Development to avoid bugs in the first place
  • Utilizing Python’s regular expression mini-language and module
  • Parsing techniques, including how to use the third-party PyParsing and PLY modules
  • Building usable, efficient, GUI-based applications
  • Advanced programming techniques, including generators, function and class decorators, context managers, descriptors, abstract base classes, metaclasses, coroutines, and more

 

Programming in Python 3, Second Edition, serves as both tutorial and language reference. It assumes some prior programming experience, and it is accompanied by extensive downloadable example code–all of it tested with Python 3 on Windows, Linux, and Mac OS X.

Author's Site

Please visit the author's web site at qtrac.eu/py3book.html.

Customer Reviews

26 of 29 people found the following review helpful
4.0 out of 5 stars A Thorough Introduction to Python, August 29, 2010
Amazon Verified Purchase(What's this?)
This review is from: Programming in Python 3: A Complete Introduction to the Python Language (2nd Edition) (Paperback)
Mark Summerfield's text: "Programming in Python 3" is a very good introduction to the Python programming language for people with prior programming experiance in another language. I came to Python from MatLab and prior to that, C and Fortan. So I'm pleased with the book and find myself refering back to it quite often. Having said that, this is not a "For Dummies" type book. Familiarity with with directory structure, file handling, and command prompt (console) operation is assumed.

The book covers all of the built in types and programming constructs of the Python language. It also introduces some of the useful (batteries included) standard library functinality along with details for working with modules and packages.

Finally, as I'm working my way into the middle of the book, I'm finding that it's a good introduction to object-oriented (OO) programming concepts and techniques in the clean syntax of the Python language. The OO concepts are not obfuscated by a... Read more
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


17 of 20 people found the following review helpful
4.0 out of 5 stars Put Your Seatbelt On, September 5, 2010
By 
B. Blazer (WI United States) - See all my reviews
(REAL NAME)   
This review is from: Programming in Python 3: A Complete Introduction to the Python Language (2nd Edition) (Paperback)
This is a great book that covers Python 3 in a very orderly and concise manner. Readers are quickly introduced to the power of the language in the first 2 chapters, then each of the topics are covered in a more in depth way later in the book. This, however, is why I gave it only 4 stars. These beginning chapters may feel intimidating to some as the may feel as though they have been dropped in the deep end of the pool. More complex concepts like short-circuit logic are given but a few lines of explanation where a more detailed analysis may be warranted. All that said, it is the book I chose as the text for the python course I teach at the college level. I have limited time to get the students up and running, and this book surely does that. It also is a good stand alone reference that many of my students have chosen to keep on their bookshelves rather than return to the bookstore at the end of the semester. In short, it is concise, fast-paced, and in depth - covering enough of the... Read more
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


10 of 12 people found the following review helpful
4.0 out of 5 stars Good book, weak exercises, December 24, 2010
By 
David K. Wittenberg (Massachusetts, USA) - See all my reviews
(REAL NAME)   
Amazon Verified Purchase(What's this?)
This review is from: Programming in Python 3: A Complete Introduction to the Python Language (2nd Edition) (Paperback)
As others have noted, this is a fast paced book which covers Python 3 very well. The only reason I give it 4 stars instead of 5 is that the exercises are not very useful. They almost all consist of minor modifications to a program which has been discussed in the text. This is not enough to learn the language. One must also write programs from scratch, or at least make major changes to existing programs.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


Share your thoughts with other customers:
 See all 19 customer reviews...

Online Sample Chapter

Regular Expressions in Python 3

Table of Contents

List of Tables xv

 

Introduction 1

 

Chapter 1: Rapid Introduction to Procedural Programming 9

Creating and Running Python Programs 9

Python’s “Beautiful Heart” 14

Examples 39

Summary 44

Exercises 47

 

Chapter 2: Data Types 51

Identifiers and Keywords 51

Integral Types 54

Floating-Point Types 58

Strings 65

Examples 94

Summary 102

Exercises 104

 

Chapter 3: Collection Data Types 107

Sequence Types 107

Set Types 120

Mapping Types 126

Iterating and Copying Collections 138

Examples 148

Summary 156

Exercises 158

 

Chapter 4: Control Structures and Functions 159

Control Structures 159

Exception Handling 163

Custom Functions 171

Example: make_html_skeleton.py 185

Summary 191

Exercise 192

 

Chapter 5: Modules 195

Modules and Packages 195

Overview of Python’s Standard Library 212

Summary 230

Exercise 231

 

Chapter 6: Object-Oriented Programming 233

The Object-Oriented Approach 234

Custom Classes 238

Custom Collection Classes 261

Summary 283

Exercises 285

 

Chapter 7: File Handling 287

Writing and Reading Binary Data 292

Writing and Parsing Text Files 305

Writing and Parsing XML Files 312

Random Access Binary Files 324

Summary 336

Exercises 337

 

Chapter 8: Advanced Programming Techniques 339

Further Procedural Programming 340

Further Object-Oriented Programming 363

Functional-Style Programming 395

Example: Valid.py 407

Summary 410

Exercises 411

 

Chapter 9: Debugging, Testing, and Profiling 413

Debugging 414

Unit Testing 425

Profiling 432

Summary 437

 

Chapter 10: Processes and Threading 439

Using the Multiprocessing Module 440

Using the Threading Module 444

Summary 454

Exercises 455

 

Chapter 11: Networking 457

Creating a TCP Client 458

Creating a TCP Server 464

Summary 471

Exercises 471

 

Chapter 12: Database Programming 475

DBM Databases 476

SQL Databases 480

Summary 487

Exercise 488

 

Chapter 13: Regular Expressions 489

Python’s Regular Expression Language 490

The Regular Expression Module 499

Summary 509

Exercises 510

 

Chapter 14: Introduction to Parsing 513

BNF Syntax and Parsing Terminology 514

Writing Handcrafted Parsers 519

Pythonic Parsing with PyParsing 534

Lex/Yacc-Style Parsing with PLY 553

Summary 566

Exercise 568

 

Chapter 15: Introduction to GUI Programming 569

Dialog-Style Programs 572

Main-Window-Style Programs 578

Summary 593

Exercises 593

 

Epilogue 595

Selected Bibliography 597

Index 599

Sample Pages

Download the sample pages (includes Chapter 13 and Index)

 
Best Value

Book + eBook Bundle  $89.98  $53.99

Book Price $39.99
eBook Price $14.00
eBook formats included

Buy

This book includes free shipping!

Buy

Book  $49.99  $39.99

Usually ships in 24 hours.

This book includes free shipping!

Buy

eBook (Watermarked)  $39.99  $31.99

Includes EPUB, MOBI, and PDF
About eBook Formats

This eBook includes the following formats, accessible from your Account page after purchase:

ePubEPUBThe open industry format known for its reflowable content and usability on supported mobile devices.

MOBIMOBIThe eBook format compatible with the Amazon Kindle and Amazon Kindle applications.

Adobe ReaderPDFThe popular standard, used most often with the free Adobe® Reader® software.

This eBook requires no passwords or activation to read. We customize your eBook by discretely watermarking it with your name, making it uniquely yours.

Purchase Reward: One Month Free Subscription
By completing any purchase on InformIT, you become eligible for an unlimited access one-month subscription to Safari Books Online.

Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.