作者:empty 页数:209 出版社:empty |
IntroductionPython is a general-purpose, object-oriented, and opensourcecomputer programming language.It is commonly used forboth standalone programs and ser png applications in a widevariety of domains, by hundreds of thousands of developersPython is designed to optimize developer productivity, soft-war equality, program portability, and component integration.Python programs run on most plat for ns in common use, in-cluding mainframes and supercomputers, Unix and Linux,Wid uws and Mai tosh, Ja vs and, NET, and more.This pocket reference summarizes Python types and state-ments, special rn ethod names, built-in functions and excep-tions, com motil y used standard library modules, and otherprominent Python tools.It is intended to serve as a concisereference t aol for developers and is designed to be a companionto other books that provide tut on als.code examples, and otherlearning materials
This fourth edtion covers both Python versions 3.0 and 26,and l are r releases in the 3.X and 2.X lines.This edition is fo-c used primarily on Python 3.0, but also documents differencesin Python 2.6, and so applies to both versions.It has beenthoroughly updated for recent language and library changesand expanded for new language tools and to pies.This edition also incorporates notes about prominent enhance-ments in the imminent Python 3.1 release, which is intendedto subsume Python 3.0(in this book, Python 3.0 generally re-fers to the language va nations introduced by 3.0bur presentin the entire 3.X line) .Much of this edition applies to earlierPython releases as well, with the exe ep tion of recent languageextensions.
Syntax Rules
Name Rules
Specifc Statements
The Assignment Statement
The Expressin Statement
The print Statement
The if Statement
The while Statement
The fr Statement
The pass Statement
The break Statement
The cntinue Statement
The del Statement
The def Statement
The return Statement
They le ld Statement
The glbal Statement
The nnlcal Statement
The imprt 5 tatement
The frm Statement
The dass Statement
The try Statement
The raise Statement
The assert Statement
The with Statement
Pythn 2.X Statements
Namespace and Scpe Rules
w|Tabe f Cent ns
Qual fied Names:bject Namespaces
Unqualified Names:Lexical Stpes
Static aly Nested Scpes
bject- rented Prgram mig
Classes and Instances
Pseud private Atti but es
New Style Classes
peratr verlad ng Methds
Fr All Types
Fr Cll ecns(Sequences, Mappings)
Fr Numbers(Binary pera t s)
Fr Numbers(ther peratins)
Fr Descriptrs
Fr Cntext Managers
Pythn 2.X0peratrveading Methds
Built-in Functins
Pythn 2.X Built-in Functins
Built-in Exceptins