My Account Log in

1 option

Learning Python

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Lutz, Mark, Author.
Contributor:
Safari Tech Books Online.
Ascher, David, Contributor.
Language:
English
Subjects (All):
Python (Computer program language).
Physical Description:
1 online resource (xvi, 366 pages) illustrations ;
Edition:
First edition.
Place of Publication:
[Place of publication not identified] : O'Reilly, 1999.
Language Note:
English
System Details:
text file
Summary:
Learning Python is an introduction to the increasingly popular Python programming language. Python is an interpreted, interactive, object-oriented scripting language. Python is growing in popularity because: It is available on all important platforms: Windows NT, Windows 95, Windows 98, Linux, all major UNIX platforms, MacOS, and even the BeOS. It is open-source software, copyrighted but freely available for use, even in commercial applications. Its clean object-oriented interface makes it a valuable prototyping tool for C++ programmers. It works well with all popular windowing toolkits, including MFC, Tk, Mac, X11, and Motif. Learning Python is written by Mark Lutz, author of Programming Python and Python Pocket Reference ; and David Ascher, a vision scientist and Python user. This book starts with a thorough introduction to the elements of Python: types, operators, statements, classes, functions, modules, and exceptions. By reading the first part of the book, the reader will be able to understand and construct programs in the Python language. In the second part of the book, the authors present more advanced information, demonstrating how Python performs common tasks and presenting real applications and the libraries available for those applications. All the examples use the Python interpreter, so the reader can type them in and get instant feedback. Each chapter ends with a series of exercises. Solutions to the exercises are in an appendix.
Contents:
Intro
Table of Contents
Preface
About This Third Edition
This Edition's Python Language Changes
This Edition's Python Training Changes
This Edition's Structural Changes
This Edition's Scope Changes
About This Book
This Book's Prerequisites
This Book's Scope and Other Books
This Book's Style and Structure
Book Updates
About the Programs in This Book
Preparing for Python 3.0
About This Series
Using Code Examples
Font Conventions
Safari® Books Online
How to Contact Us
Acknowledgments
Part I
A Python Q&amp
A Session
Why Do People Use Python?
Software Quality
Developer Productivity
Is Python a "Scripting Language"?
OK, but What's the Downside?
Who Uses Python Today?
What Can I Do with Python?
Systems Programming
GUIs
Internet Scripting
Component Integration
Database Programming
Rapid Prototyping
Numeric and Scientific Programming
Gaming, Images, AI, XML, Robots, and More
What Are Python's Technical Strengths?
It's Object Oriented
It's Free
It's Portable
It's Powerful
It's Mixable
It's Easy to Use
It's Easy to Learn
It's Named After Monty Python
How Does Python Stack Up to Language X?
Chapter Summary
Quiz Answers
How Python Runs Programs
Introducing the Python Interpreter
Program Execution
The Programmer's View
Python's View
Byte code compilation
The Python Virtual Machine (PVM)
Performance implications
Development implications
Execution Model Variations
Python Implementation Alternatives
CPython
Jython
IronPython
Execution Optimization Tools
The Psyco just-in-time compiler
The Shedskin C++ translator
Frozen Binaries
Future Possibilities?
How You Run Programs
Interactive Coding
Using the Interactive Prompt.
System Command Lines and Files
Using Command Lines and Files
Unix Executable Scripts (#!)
Clicking File Icons
Clicking Icons on Windows
The raw_input Trick
Other Icon-Click Limitations
Module Imports and Reloads
The Grander Module Story: Attributes
Modules and namespaces
import and reload Usage Notes
The IDLE User Interface
IDLE Basics
Using IDLE
Advanced IDLE Tools
Other IDEs
Embedding Calls
Frozen Binary Executables
Text Editor Launch Options
Other Launch Options
Which Option Should I Use?
Part II
Introducing Python Object Types
Why Use Built-in Types?
Python's Core Data Types
Numbers
Strings
Sequence Operations
Immutability
Type-Specific Methods
Getting Help
Other Ways to Code Strings
Pattern Matching
Lists
Type-Specific Operations
Bounds Checking
Nesting
List Comprehensions
Dictionaries
Mapping Operations
Nesting Revisited
Sorting Keys: for Loops
Iteration and Optimization
Missing Keys: if Tests
Tuples
Why Tuples?
Files
Other File-Like Tools
Other Core Types
How to Break Your Code's Flexibility
User-Defined Classes
And Everything Else
Python Numeric Types
Numeric Literals
Built-in Numeric Tools and Extensions
Python Expression Operators
Mixed Operators Follow Operator Precedence
Parentheses Group Subexpressions
Mixed Types Are Converted Up
Preview: Operator Overloading
Numbers in Action
Variables and Basic Expressions
Numeric Display Formats
Division: Classic, Floor, and True
Bitwise Operations
Long Integers
Complex Numbers
Hexadecimal and Octal Notation
Other Built-in Numeric Tools
Other Numeric Types.
Decimal Numbers
Sets
Booleans
Third-Party Extensions
The Dynamic Typing Interlude
The Case of the Missing Declaration Statements
Variables, Objects, and References
Types Live with Objects, Not Variables
Objects Are Garbage-Collected
Shared References
Shared References and In-Place Changes
Shared References and Equality
Dynamic Typing Is Everywhere
String Literals
Single- and Double-Quoted Strings Are the Same
Escape Sequences Represent Special Bytes
Raw Strings Suppress Escapes
Triple Quotes Code Multiline Block Strings
Unicode Strings Encode Larger Character Sets
Strings in Action
Basic Operations
Indexing and Slicing
Extended slicing: the third limit
String Conversion Tools
Character code conversions
Changing Strings
String Formatting
Advanced String Formatting
Dictionary-Based String Formatting
String Methods
String Method Examples: Changing Strings
String Method Examples: Parsing Text
Other Common String Methods in Action
The Original string Module
General Type Categories
Types Share Operation Sets by Categories
Mutable Types Can Be Changed In-Place
Lists and Dictionaries
Lists in Action
Basic List Operations
Indexing, Slicing, and Matrixes
Changing Lists In-Place
Index and slice assignments
List method calls
Other common list operations
Dictionaries in Action
Basic Dictionary Operations
Changing Dictionaries In-Place
More Dictionary Methods
A Languages Table
Dictionary Usage Notes
Using dictionaries to simulate flexible lists
Using dictionaries for sparse data structures
Avoiding missing-key errors
Using dictionaries as "records".
Other ways to make dictionaries
Tuples, Files, and Everything Else
Tuples in Action
Tuple syntax peculiarities: commas and parentheses
Conversions and immutability
Why Lists and Tuples?
Opening Files
Using Files
Files in Action
Storing and parsing Python objects in files
Storing native Python objects with pickle
Storing and parsing packed binary data in files
Other File Tools
Type Categories Revisited
Object Flexibility
References Versus Copies
Comparisons, Equality, and Truth
The Meaning of True and False in Python
Python's Type Hierarchies
Other Types in Python
Built-in Type Gotchas
Assignment Creates References, Not Copies
Repetition Adds One Level Deep
Beware of Cyclic Data Structures
Immutable Types Can't Be Changed In-Place
Part III
Introducing Python Statements
Python Program Structure Revisited
Python's Statements
A Tale of Two ifs
What Python Adds
What Python Removes
Parentheses are optional
End of line is end of statement
End of indentation is end of block
Why Indentation Syntax?
A Few Special Cases
Statement rule special cases
Block rule special case
A Quick Example: Interactive Loops
A Simple Interactive Loop
Doing Math on User Inputs
Handling Errors by Testing Inputs
Handling Errors with try Statements
Nesting Code Three Levels Deep
Assignment, Expressions, and print
Assignment Statements
Assignment Statement Forms
Sequence Assignments
Advanced sequence assignment patterns
Multiple-Target Assignments
Multiple-target assignment and shared references
Augmented Assignments
Augmented assignment and shared references
Variable Name Rules
Naming conventions.
Names have no type, but objects do
Expression Statements
Expression Statements and In-Place Changes
print Statements
The Python "Hello World" Program
Redirecting the Output Stream
The print &gt
&gt
file Extension
if Tests
if Statements
General Format
Basic Examples
Multiway Branching
Python Syntax Rules
Block Delimiters
Statement Delimiters
Truth Tests
The if/else Ternary Expression
while and for Loops
while Loops
Examples
break, continue, pass, and the Loop else
General Loop Format
pass
continue
break
else
More on the loop else clause
for Loops
Basic usage
Other data types
Tuple assignment in for
Nested for loops
Iterators: A First Look
File Iterators
Other Built-in Type Iterators
Other Iteration Contexts
User-Defined Iterators
Loop Coding Techniques
Counter Loops: while and range
Nonexhaustive Traversals: range
Changing Lists: range
Parallel Traversals: zip and map
Dictionary construction with zip
Generating Both Offsets and Items: enumerate
List Comprehensions: A First Look
List Comprehension Basics
Using List Comprehensions on Files
Extended List Comprehension Syntax
The Documentation Interlude
Python Documentation Sources
# Comments
The dir Function
Docstrings: _ _doc_ _
User-defined docstrings
Docstring standards
Built-in docstrings
PyDoc: The help Function
PyDoc: HTML Reports
Standard Manual Set
Web Resources
Published Books
Common Coding Gotchas
Part IV
Function Basics
Why Use Functions?
Coding Functions
def Statements.
def Executes at Runtime.
Notes:
Bibliographic Level Mode of Issuance: Monograph
Includes index.
Description based on publisher supplied metadata and other sources.
ISBN:
9781565928930
1565928938
OCLC:
774401972

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