Next:
1 Whetting Your Appetite
Up:
Python Tutorial - DRAFT
Previous:
Python Tutorial - DRAFT
Contents
1 Whetting Your Appetite
1.1 Disclaimer
1.2 Introduction
1.3 Where From Here
2 Using the Python Interpreter
2.1 Invoking the Interpreter
2.1.1 Argument Passing
2.1.2 Interactive Mode
2.2 The Interpreter and its Environment
2.2.1 Error Handling
2.2.2 Executable Python scripts
2.2.3 The Interactive Startup File
3 An Informal Introduction to Python
3.1 Using Python as a Calculator
3.1.1 Numbers
3.1.2 Strings
3.1.3 Lists
3.2 First Steps Towards Programming
4 More Control Flow Tools
4.1 If Statements
4.2 For Statements
4.3 The
range()
Function
4.4 Break and Continue Statements, and Else Clauses on Loops
4.5 Pass Statements
4.6 Defining Functions
4.7 More on Defining Functions
4.7.1 Default Argument Values
4.7.2 Keyword Arguments
4.7.3 Arbitrary Argument Lists
5 Data Structures
5.1 More on Lists
5.1.1 Functional Programming Tools
5.2 The
del
statement
5.3 Tuples and Sequences
5.4 Dictionaries
5.5 More on Conditions
5.6 Comparing Sequences and Other Types
6 Modules
6.1 More on Modules
6.1.1 The Module Search Path
6.1.2 ``Compiled'' Python files
6.2 Standard Modules
6.3 The
dir()
function
7 Input and Output
7.1 Fancier Output Formatting
7.2 Reading and Writing Files
7.2.1 Methods of file objects
7.2.2 The pickle module
8 Errors and Exceptions
8.1 Syntax Errors
8.2 Exceptions
8.3 Handling Exceptions
8.4 Raising Exceptions
8.5 User-defined Exceptions
8.6 Defining Clean-up Actions
9 Classes
9.1 A word about terminology
9.2 Python scopes and name spaces
9.3 A first look at classes
9.3.1 Class definition syntax
9.3.2 Class objects
9.3.3 Instance objects
9.3.4 Method objects
9.4 Random remarks
9.5 Inheritance
9.5.1 Multiple inheritance
9.6 Private variables through name mangling
9.7 Odds and ends
9.7.1 Exceptions Can Be Classes
10 What Now?
11 Recent Additions as of Release 1.1
11.1 Lambda Forms
11.2 Documentation Strings
A Interactive Input Editing and History Substitution
A.0.1 Line Editing
A.0.2 History Substitution
A.0.3 Key Bindings
A.0.4 Commentary
About this document ...
guido@CNRI.Reston.Va.US