My Account Log in

1 option

Learning Python / by Mark Lutz and David Ascher.

Van Pelt Library QA76.73.P98 L877 2004
Loading location information...

By Request Item cannot be checked out at the library but can be requested.

Log in to request item
Format:
Book
Author/Creator:
Lutz, Mark.
Contributor:
Ascher, David.
Language:
English
Subjects (All):
Python (Computer program language).
Object-oriented programming (Computer science).
Physical Description:
xxvi, 591 pages : illustrations ; 24 cm
Edition:
Second edition.
Place of Publication:
Sebastopol, CA : O'Reilly, [2003]
Summary:
Python is a popular open source, object-oriented programming language used for both standalone programs and scripting applications. Portable, powerful, and a breeze to use, there's no quicker way to master the language than to learn from expert teachers. This new edition of Learning Python puts you in the hands of Mark Lutz and David Ascher, two notable Python experts and trainers whose friendly, well-structured prose has guided many programmers to proficiency in the language. Learning Python, Second Edition offers programmers a comprehensive learning tool for Python and object-oriented programming. Thoroughly updated for the numerous language changes since the release of the first edition in 1999, this book introduces the basic elements of the latest release of Python 2.3 and covers new features, such as list comprehensions, nested scopes, and iterators/generators.
Beyond language features, this edition of Learning Python also includes new context for less-experienced programmers, including fresh overviews of object-oriented programming and dynamic typing, new discussions of program launch and configuration options, new coverage of documentation sources, and more. There are also new use cases throughout to make the application of language features more concrete. Learning Python starts by giving programmers all the information they'll need to understand and construct programs in the Python language, including types, operators, statements, classes, functions, modules, and exceptions. The authors then present more advanced material, showing how Python performs common tasks by offering real applications and the libraries available for those applications. There are exercises throughout the book to test your new skills. Learning Python, Second Edition is a self-paced book that allows readers to focus on the core Python language in depth. As you work through the book, you'll gain a deep and complete understanding of the Python language that will help you to develop larger applications on your own. This book is for anyone who doesn't want to stop at just learning Python, but wants to master it as well.
Contents:
Why Do People Use Python? 3
Is Python a Scripting Language? 5
Okay, But What's the Downside? 6
Who Uses Python Today? 7
What Can I Do with Python? 8
What Are Python's Technical Strengths? 11
How Does Python Stack Up to Language X? 14
2. How Python Runs Programs 16
Introducing the Python Interpreter 16
Program Execution 17
Execution Model Variations 21
3. How You Run Programs 25
Interactive Coding 25
System Command Lines and Files 28
Clicking Windows File Icons 32
Module Imports and Reloads 36
The IDLE User Interface 40
Other IDEs 44
Embedding Calls 46
Frozen Binary Executables 47
Text Editor Launch Options 47
Other Launch Options 47
Future Possibilities? 47
Which Option Should I Use? 48
Part II. Types and Operations
4. Numbers 53
Python Program Structure 53
Why Use Built-in Types? 53
Numbers 55
Python Expression Operators 57
Numbers in Action 60
The Dynamic Typing Interlude 68
5. Strings 74
String Literals 75
Strings in Action 81
String Formatting 87
String Methods 90
General Type Categories 95
6. Lists and Dictionaries 97
7. Tuples, Files, and Everything Else 112
Type Categories Revisited 117
Object Generality 118
References Versus Copies 118
Comparisons, Equality, and Truth 121
Python's Type Hierarchies 123
Other Types in Python 125
Built-in Type Gotchas 125
Part III. Statements and Syntax
8. Assignment, Expressions, and Print 133
Assignment Statements 134
Expression Statements 140
Print Statements 142
9. if Tests 146
if Statements 146
Python Syntax Rules 149
Truth Tests 152
10. while and for Loops 155
break, continue, pass, and the Loop else 156
Loop Variations 164
11. Documenting Python Code 171
The Python Documentation Interlude 171
Common Coding Gotchas 182
Part IV. Functions
Why Use Functions? 189
Coding Functions 190
A First Example: Definitions and Calls 193
A Second Example: Intersecting Sequences 194
13. Scopes and Arguments 197
Scope Rules 197
The global Statement 202
Scopes and Nested Functions 203
Passing Arguments 207
Special Argument Matching Modes 210
14. Advanced Function Topics 219
Anonymous Functions: lambda 219
Applying Functions to Arguments 224
Mapping Functions Over Sequences 227
Functional Programming Tools 228
List Comprehensions 229
Generators and Iterators 233
Function Design Concepts 236
Function Gotchas 239
Part V. Modules
Why Use Modules? 247
Python Program Architecture 248
How Imports Work 251
16. Module Coding Basics 257
Module Creation 257
Module Usage 258
Module Namespaces 261
Reloading Modules 266
17. Module Packages 270
Package Import Basics 270
Package Import Example 273
Why Use Package Imports? 275
A Tale of Three Systems 275
18. Advanced Module Topics 279
Data Hiding in Modules 279
Enabling Future Language Features 280
Mixed Usage Modes: __name__ and __main__ 280
Changing the Module Search Path 281
The import as Extension 282
Module Design Concepts 282
Module Gotchas 285
Part VI. Classes and OOP
19. OOP: The Big Picture 297
Why Use Classes? 297
OOP from 30,000 Feet 299
20. Class Coding Basics 307
Classes Generate Multiple Instance Objects 307
Classes Are Customized by Inheritance 310
Classes Can Intercept Python Operators 314
21. Class Coding Details 317
The Class Statement 317
Methods 320
Inheritance 322
Operator Overloading 327
Namespaces: The Whole Story 337
22. Designing with Classes 343
Python and OOP 343
Classes as Records 344
OOP and Inheritance: "is-a" Relationships 346
OOP and Composition: "has-a" Relationships 348
OOP and Delegation 352
Multiple Inheritance 353
Classes Are Objects: Generic Object Factories 356
Methods Are Objects: Bound or Unbound 358
Documentation Strings Revisited 360
Classes Versus Modules 362
23. Advanced Class Topics 363
Extending Built-in Types 363
Pseudo-Private Class Attributes 366
"New Style" Classes in Python 2.2 369
Class Gotchas 376
Part VII. Exceptions and Tools
Why Use Exceptions? 393
Exception Handling: The Short Story 395
The try/except/else Statement 399
The try/finally Statement 404
The raise Statement 405
The assert Statement 408
25. Exception Objects 410
String-Based Exceptions 410
Class-Based Exceptions 411
General raise Statement Forms 418
26. Designing with Exceptions 420
Nesting Exception Handlers 420
Exception Idioms 423
Exception Design Tips 426
Exception Gotchas 430
Core Language Summary 432
Part VIII. The Outer Layers
27. Common Tasks in Python 439
Conversions, Numbers, and Comparisons 443
Manipulating Strings 447
Data Structure Manipulations 452
Manipulating Files and Directories 458
Internet-Related Modules 473
Executing Programs 477
Debugging, Testing, Timing, Profiling 480
28. Frameworks 485
An Automated Complaint System 486
Interfacing with COM: Cheap Public Relations 492
A Tkinter-Based GUI Editor for Managing Form Data 496
Jython: The Felicitous Union of Python and Java 504
29. Python Resources 513
Layers of Community 513
The Process 517
Services and Products 518
The Legal Framework: The Python Software Foundation 518
Software 518
Popular Third-Party Software 520
Web Application Frameworks 529
Tools for Python Developers 531.
Notes:
"Covers Python 2.3"--Cover.
"Object-oriented programming"--Cover.
Previous ed.: 1999.
ISBN:
0596002815
OCLC:
55847258

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account