Programming in Python 3: A Complete Introduction to the Python Language (häftad)
Fler böcker inom
Format
Häftad (Paperback)
Språk
Engelska
Antal sidor
648
Utgivningsdatum
2009-11-24
Upplaga
2
Förlag
ADDISON-WESLEY
Illustrationer
illustrations
Dimensioner
228 x 181 x 32 mm
Vikt
1067 g
Antal komponenter
1
ISBN
9780321680563

Programming in Python 3: A Complete Introduction to the Python Language

Häftad,  Engelska, 2009-11-24

Slutsåld



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 3s 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 wont find anywhere else. He begins by illuminating Pythons 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 expertiseone 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 keyvalue DBM files
  • Debugging techniquesand using Test Driven Development to avoid bugs in the first place
  • Utilizing Pythons 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 codeall of it tested with Python 3 on Windows, Linux, and Mac OS X.

Kundrecensioner

Har du läst boken? Sätt ditt betyg »

Fler böcker av Mark Summerfield

  • Programming in Go

    Mark Summerfield

    Your Hands-On Guide to Go, the Revolutionary New Language Designed for Concurrency, Multicore Hardware, and Programmer Convenience Today's most exciting new programming language, Go, is designed from the ground up to help you easily leverage all t...

  • Python in Practice

    Mark Summerfield

    Winner of the 2014 Jolt Award for &quote;Best Book&quote; &quote;Whether you are an experienced programmer or are starting your career, Python in Practice is full of valuable advice and example to help you improve your craft by thinking about prob...

Recensioner i media

Fulfills the immediate market need for those developers seeking to learn this latest evolutionary version of the Python lineage in a succinct, well-written package.

Mike Riley, Contributing Editor for Dr. Dobbs

 

Beyond the introduction to programming in Python 3 in the first chapter, if you progress through the first six chapters in sequence, youll be well on your way to taking off with using Python independently.

James Pyles, Technical Writer and Author of the blog A Million Chimpanzees

 

A key recommendation for any serious computer library strong in web programming languages.

Jim Cox, Midwest Book Review

 

Summerfields book is an excellent source to start learning Python 3.

Anthony J. Duben, Computing Reviews

Övrig information

Mark Summerfield graduated in computer science with first class honors from the University of Wales Swansea. He followed this with a year's postgraduate research before going into industry. He spent many years working as a software engineer for a variety of firms before joining Trolltech. He spent almost three years as Trolltech's documentation manager, during which he founded and edited Trolltech's technical journal, Qt Quarterly. Mark is the coauthor of C++ GUI Programming with Qt 3 and C++ GUI Programming with Qt 4, and author of Rapid GUI Programming with Python and Qt: The Definitive Guide to PyQt Programming. Mark owns Qtrac Ltd., www.qtrac.eu, where he works as an independent author, editor, trainer, and consultant, specializing in C++, Qt, Python, and PyQt.

Innehållsförteckning

List of Tables xv

 

Introduction 1

 

Chapter 1: Rapid Introduction to Procedural Programming 9

Creating and Running Python Programs 9

Pythons 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 Pythons 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

Pythons 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 Han...