书籍封面
书籍目录
0672328623
Table of Contents
Introduction
I: The Python Language
1 A Tutorial Introduction
Running Python
Variables and Arithmetic Expressions
Conditionals
File Input and Output
Strings
Lists
Tuples
Sets
Dictionaries
Iteration and Looping
Functions
Classes
Exceptions
Modules
Getting Help
2 Lexical Conventions and Syntax
Line Structure and Indentation
Identifiers and Reserved Words
Literals
Operators, Delimiters, and Special Symbols
Documentation Strings
Decorators
Source Code Encoding
3 Types and Objects
Terminology
Object Identity and Type
Reference Counting and Garbage Collection
References and Copies
Built-in Types
Special Methods
Performance Considerations
4 Operators and Expressions
Operations on Numbers
Operations on Sequences
Operations on Dictionaries
Operations on Sets
Augmented Assignment
The Attribute (.) Operator
Type Conversion
Unicode Strings
Boolean Expressions and Truth Values
Object Equality and Identity
Order of Evaluation
5 Control Flow
Conditionals
Loops and Iteration
Exceptions
Defining New Exceptions
Assertions and _ _debug_ _
6 Functions and Functional Programming
Functions
Parameter Passing and Return Values
Scoping Rules
Functions as Objects
Recursion
The apply( ) Function
The lambda Operator
map( ), zip( ), reduce( ), and filter()
List Comprehensions
Generators and yield
Generator Expressions
Function Decorators
eval( ), exec, execfile( ), and compile( )
7 Classes and Object-Oriented Programming
The class Statement
Class Instances
Reference Counting and Instance Destruction
Inheritance
Polymorphism
Information Hiding
Operator Overloading
Types and Class Membership Tests
Classic Classes
Metaclasses
8 Modules and Packages
Modules
The Module Search Path
Module Loading and Compilation
Module Reloading
Packages
9 Input and Output
Reading Options and Environment Variables
Files and File Objects
Standard Input, Output, and Error
The print Statement
Persistence
Unicode I/O
10 Execution Environment
Interpreter Options and Environment
Interactive Sessions
Launching Python Applications
Site Configuration Files
Enabling Future Features
Program Termination
II: The Python Library
11 Introduction to the Python Standard Library
Library Overview
Preview
12 Built-in Functions and Exceptions
Built-in Functions
Built-in Exceptions
13 Python Runtime Services
atexit
code
copy
copy_reg
_ _future_ _
gc
inspect
marshal
new
operator
pickle and cPickle
site
sys
traceback
types
warnings
weakref
UserDict, UserList, and UserString
14 Mathematics
cmath
decimal
math
random
15 Data Structures and Algorithms
array
bisect
collections
heapq
itertools
16 String and Text Handling
codecs
difflib
gettext
re
string
StringIO and cStringIO
struct
textwrap
unicodedata
17 Data Management and Object Persistence
Introduction
anydbm
bsddb
dbhash
dbm
dumbdbm
gdbm
shelve
whichdb
18 File Handling
bz2
csv
filecmp
fileinput
fnmatch
glob
gzip
tarfile
zipfile
zlib
19 Operating System Services
commands
crypt
datetime
dl
errno
fcntl
getopt
getpass
grp
locale
logging
mmap
msvcrt
optparse
os
os.path
platform
popen2
pwd
resource
shutil
signal
stat
statvfs
subprocess
tempfile
termios
time
tty
_winreg
20 Threads
Thread Basics
Python Threads
thread
threading
Queue
21 Network Programming
Introduction
asynchat
asyncore
select
socket
SocketServer
22 Internet Application Protocols
BaseHTTPServer
cgi
cgitb
CGIHTTPServer
Cookie
cookielib
DocXMLRPCServer
encodings.idna
ftplib
httplib
imaplib
nntplib
poplib
robotparser
SimpleHTTPServer
SimpleXMLRPCServer
smtplib
urllib
urllib2
urlparse
webbrowser
xmlrpclib
23 Internet Data Handling and Encoding
base64
binascii
binhex
HTMLParser
mailcap
mimetypes
quopri
rfc822
uu
xdrlib
xml
xml.dom
xml.dom.minidom
xml.sax
xml.sax.saxutils
24 Cryptographic Services
hmac
md5
sha
25 Miscellaneous Modules
Python Services
String Processing
Operating System Modules
Network
Internet Data Handling
Multimedia Services
Miscellaneous
26 Debugging, Profiling, and Testing
doctest
hotshot
pdb
profile
pstats
timeit
unittest
III: Extending and Embedding
27 Extending and Embedding Python
Extension Module Example
Compilation of Extensions
Converting Data from Python to C
Converting Data from C to Python
Error Handling
Reference Counting
Calling Python from C
Abstract Object Layer
Low-level Functions on Built-in Types
Threads
Embedding
Defining New Python Types
Extension Building Tools
Index
A
B
C
D
E
F
G
H
I
J-K
L
M
N
O
P
Q
R
S
T
U
V
W
X-Y-Z
没有回复内容