學習PYTHON 第三版(英文影印版)

出版時間:2008-8-1  出版社:東南大學出版社  作者:(美國)(Lutz.M.)盧茨  頁數(shù):700  
Tag標簽:無  

前言

  About This Third Edition .  In the four years since the second edition of this book was published in late 2003, there have been substantial changes in Python itself, and in the topics I present in Python training sessions. Although I have attempted to retain as much of the prior version of this text as possible, this new edition reflects many recent changes in the Python language and in Python training, as well as a handful of structural changes.  This Edition’s Python Language Changes On the language front, this edition has been thoroughly updated to reflect Python 2.5 and all changes to the language since the publication of the second edition. (The second edition was based largely on Python 2.2, with some 2.3 features grafted on at the end of the project.) In addition, discussions of anticipated changes in the upcoming Python 3.0 release have been incorporated where appropriate. Here are some of the major language topics of which you’ll find new or expanded coverage in this edition:  The new B if A else C conditional expression (Chapter 12).  with/as context managers (Chapter 27).  try/except/finally unification (Chapter 27).  Relative import syntax (Chapter 21). ..  Generator expressions (Chapter 17).  New generator function features (Chapter 17).  Function decorators (Chapter 26).  The set object type (Chapter 5).  New built-in functions: sorted, sum, any, all, enumerate (Chapters 4 and 13).  The decimal fixed-precision object type (Chapter 5).  New and expanded material on files, list comprehensions, iterators, and more (Chapters 13 and 17).  New development tools coverage: Eclipse, distutils, unittest and doctest, IDLE enhancements, Shedskin, and so on (Chapters 3 and 29).  Smaller language changes (for instance, the widespread use of True and False, the new sys.exc_info for fetching exception details, and the demise of string-based exceptions, string methods, and the apply and reduce built-ins) are discussed throughout the book. In addition, some of the features that were new in the prior edition enjoy substantially expanded coverage here, including three-limit slices, and the arbitrary arguments call syntax that subsumes apply.

內容概要

  Python是一種理想的獨立程序和腳本程序語言,具有可移植、強大和易用的特點。無論您是初學程序設計還是初學Python,都能通過本書快速而高效地掌握Python核心語言的基礎。通讀本書,您可以獲得足夠多的知識,能夠學習將Python用于您所選擇的任何應用領域?!  秾W習Python(第三版)》基于作者Mark Lutz在過去10年間講授培訓課程所使用的資料。除了大量的注解插圖和每章總結外,作者還為每章加入了獨特的一節(jié),通過實際練習和復習提問的方式,讓您在學習過程中練習新的技能,測驗對概念的理解程度。  本書內容包括:  類型和運算——深入Python內置對象類型:數(shù)值、列表、字典及其他?! ≌Z句和語法——用來創(chuàng)建和處理對象的Python代碼以及Python通用語法模型。  函數(shù)——Python的基本結構化和代碼重用工具。  模塊——將語句、函數(shù)和其他工具組織為更大的組件。  類和面向對象編程——可選的Python面向對象程序設計工具,用于定制和重用結構化代碼?! ‘惓:凸ぞ摺幚碚Z句和模塊異常,并介紹編寫較大型程序所使用的開發(fā)工具?! ∮嘘P即將發(fā)布的Python 3.0的一些討論。  《學習Python 第三版》為您理解Python語言提供了完整而又深入的介紹,幫助您領會在以后的工作中會遇到的應用級Python實例。如果您準備好探索Google和YouTube究竟從Python中發(fā)現(xiàn)了什么,那么本書就是一個最好的開始。

作者簡介

  盧茨 (Lutz.M.),作為Python培訓界的領軍人物,Mark Lutz是有關Python方面的最早和最暢銷書籍的作者,并且從1992年起就是Python社區(qū)的先驅之一。同時他還是OReilly的《Programming Python》和《Python Pocket Reference》兩本書的作者。Mark從1997年開始教授Python課程,截至2007年已經指導了超過200次培訓。此外Mark擁有計算機科學學士和碩士學位,以及25年的軟件開發(fā)經驗。

書籍目錄

PrefacePartⅠ.Getting Started1.A Python Q&A SessionWhy Do People Use Python?Software Quality Developer ProductivityIs Python a“Scripting Language”?OK,but What’S the Downside?Who Uses Python Today?What Can I Do with Python?Systems ProgrammingGUIsInternet ScriptingComponent IntegrationDatabase ProgrammingRapid PrototypingNumeric and Scientific ProgrammingGaming,Images,AI,XML,Robots,and MoreWhat Are Python’S Technical Strengths?It’S Object OrientedIt’S FreeIt’S PortableIt’S PowerfulIt’S Mixable  It’S Easy to UseIt’S Easy to LearnIt’s Named After Monty PythonHow Does Python Stack Up to Language X?Chapter SummaryBrain BuilderChapter QuizQuiz Answers2.How Python Runs ProgramsIntroducing the Python InterpreterProgram ExecutionThe Programmer’S ViewPython’S ViewByte code compilationThe Python Virtual Machine(PVM)Performance implicationsDevelopment implicationsExecution Model VariationsPython Implementation Alternatives  CPythonJythonIronPythonExecution Optimization ToolsThe Psyco just-in-time compilerThe Shedskin C++translatorFrozen BinariesFuture Possibilities?Chapter SummaryBrain BuilderChapter QuizQuiz Answers3.How You Run ProgramsInteractive CodingUsing the Interactive PromptSystem Command Lines and FilesUsing Command Lines and FilesUnix Executable Scripts(#!)Clicking File IconsClicking Icons on WindowsThe raw_input Trick0ther Icon-Click LimitationsModule Imports and ReloadsThe Grander Module Story:AttributesModules and namespacesimport and reload Usage NotesThe IDLE User InterfaceIDLE BasicsUsing 1DLEAdvanced 1DLE Tools0ther IDEsEmbedding CallsFrozen Binary ExecutablesText Editor Launch Options0ther Launch OptionsFuture Possibilities?Which 0ption Should I Use?Chapter SummaryBrain BuilderChapter QuizOuiz AnswersBrain Builder:Part I ExercisesPartⅡ.Types and Operations4.Introducing Python 0bject TypesWhy Use Built—in Types?Python’S Core Data TypesNumbersStringsSequence OperationsImmutabilityType—Specific MethodsGetting HelpOther Ways to Code StringsPattern MatchingListsSequence OperationsType—Specific OperationsBounds CheckingNestingList ComprehensionsDictionariesMapping OperationsNesting RevisitedSorting Keys:for LoopsIteration and OptimizationMissing Keys:if TestsTuples  Why Tuples?FilesOther File-Like ToolsOther Core TypesHow to Break Your Code’S Flexibility  User—Defined ClassesAnd Everything ElseChapter SummaryBrain BuilderChapter QuizQuiz Answers5.Numbers Python Numeric TypesNumeric LiteralsBuilt—in Numeric Tools and ExtensionsPython Expression OperatorsMixed Operators Follow Operator PrecedenceParentheses Group SubexpressionsMixed Types Are Converted UpPreview:Operator OverloadingNumbers in ActionVariables and Basic ExpressionSNumeric Display FormatsDivision:Classic,F(xiàn)loor,and TrueBitwise OperationsLong IntegersComplex NumbersHexadecimal and Octal NotationOther Built.in Numeric ToolsOther Numeric TypesDecimal NumbersSetsBooleansThird.Party ExtensionsChapter SummaryBrain BuilderChapter QuizQuiz Answers6.The DynamicTyping InterludeThe Case of the Missing Declaration StatementsVariables,Objects,and ReferencesTypes Live with Objects,Not VariablesObjects Are Garbage—CollectedShared Refe:rencesShared References and In—Place ChangesShared References and EqualityDynamic Typing Is EverywhereChapter SummaryBrain BuilderChapter QuizQuiz Answers7.StringsString LiteralsSingle,and Double.Quoted Strings Are the SameEscape Sequences Represent Special BytesRaw Strings Suppress EscapesTriple Quotes Code Multiline Block StringsUnicode Strings Encode Larger Character SetsStrings in ActionBasic OperationsIndexing and Slicing  Extended slicing:the third limitString Conversion ToolsCharacter code conversionsChanging StringsString FormattingAdvanced String FormattingDictionary—Based String FormattingString MethodsString Method Examples:Changing StringsString Method Examples:Parsing TextOther Common String Methods in ActionThe Original string ModuleGeneral Type CategoriesTypes Share Operation Sets by CategoriesMutable Types Can Be Changed In—PlaceChapter SummaryBrain BuilderChapter Quizquiz Answers8.Lists and DictionariesListsLists in ActionBasic List OperationsIndexing,Slicing,and MatrixesChanging Lists In—Place Index and slice assignmentsList method callsOther common list operationsDictionariesDictionaries in ActionBasic Dictionary OperationsChanging Dictionaries In—PlaceMore Dictionary MethodsA Languages TableDictionary Usage NotesUsing dictionaries to simulate flexible listsUsing dictionaries for sparse data structuresAvoiding missing-key errorsUsing dictionaries as“records”O(jiān)ther ways to make dictionariesChapter SummaryBrain BuilderChapter QuizQuiz Answers9.Tuples,Files,and Everthing ElseTuplesTuples in ActionTuple syntax peculiarities:commas and parenthesesConversions and immutabilityWhy Lists and Tuples?FilesOpening FilesUsing FilesFiles in ActionStoring and parsing Python objects in filesStoring native Python objects with pickleStoring and parsing packed binary data in filesOther File ToolsType Categories RevisitedObject FlexibilityReferences Versus CopiesComparisons,Equality,and TruthThe Meaning of True and False in PythonPython’S Type HierarchiesOther Types in PythonBuilt.in Type GotchasAssignment Creates References,Not CopiesRepetition Adds One Level Deep  Beware of Cyclic Data StructuresImmutable Types Can’t Be Changed In-PlaceChapter SummaryBrain BuilderChapter QuizQuiz AnswersBrain Builder:Part II ExercisesPartⅢ Statements and SyntaxIntroducing Python StatementsPython Program Structure RevisitedPython’S StatementsATale ofTwo ifsWhat Python AddsWhat Python RemovesParentheses are optionalEnd of line iS end of statementEnd of indentation iS end of blockWhy Indentation Syntax?A Few Special CasesStatement rule special casesBlock rule special caseA Quick Example:Interactive LoopsA Simple Interactive LoopDoing Math on User InputsHandling Errors by Testing InputsHandling Errors with try StatementsNesting Code Three Levels DeepChapter SummaryBrain BuilderChapter QuizQuiz Answers11.Assignment,Expressions,and printAssignment StatementsAssignment Statement FormsSequence AssignmentsAdvanced sequence assignment patternsMultiple—Target AssignmentsMultiple—target assignment and shared referencesAugmented AssignmentsAugmented assignment and shared referencesVariable Name RulesNaming conventionsNames have no type,but objects doExpression StatementsExpression Statements and In-Place Changesprint StatementsThe Python“Hello World”ProgramRedirecting the Output StreamThe print〉〉file ExtensionChapter SummaryBrain BuilderChapter QuizQuiz Answers12.if Tesisif Statements  General FormatBasic ExamplesMultiway BranchingPython Syntax RulesBlock DelimitersStatement DelimitersA Few Special CasesTruth TestsThe if/else Ternary ExpressionChapter SummaryBrain BuilderChapter QuizQuiz Answers13.while and for Loopswhile LoopsGeneral FormatExamplesbreak,continue,pass,and the Loop elseGeneral Loop FormatExamplespasscontinuebreakelseMore on the loop else clauseforLoopsGeneral FormatExamplesBasic usageOther data typesTuple assignment in forNested for loopsIterators:A First LookFile IteratorsOther Built—in Type IteratorsOther Iteration ContextsUser—Defined IteratorsLoop Coding TechniquesCounter Loops:while and rangeNonexhaustive Traversals:rangeChanging Lists:rangeParallel Traversals:zip and mapDictionary construction with zipGenerating Both 0ffsets and Items:enumerateList Comprehensions:A First LookList Comprehension BasicsUsing List Comprehensions on FilesExtended List Comprehension SyntaxChapter SummaryBrain BuilderChapter QuizQuiz Answers14.The Documentation InterludePython Documentation Sources#CommentsThe dir FunctionDocstrings:--doc--User-defined docstringsDocstring standardsBuilt-in docstringsPyDoc:The help FunctionPyDoc:HTML ReportsStandard Manual SetWeb ResourcesPublished BooksCommon Coding Gotchas……PartⅣ Function15.Function Basics16.Scopes and Arguments17.Advanced Function TopicsPartⅤ.Modules18.Modules:The Big Picture19.Module Coding Basics20.Module Packages21.Advanced Module TopicsPartⅥ Classes and OOP22.OOP:The Big Picture23.Class Coding Basics24.Class Coding Details25.Designing with Classes26.Advanced Class TopicsPartⅦ Exceptions and Tools27.Exception Basics28.Exception Objects29.Designing with ExceptionsPartⅧ AppendixesA.Installation and ConfigurationB.Solutions to End-of-Part ExercisesIndex

編輯推薦

  盧茨(Lutz,M),作為Python培訓界的領軍人物,Mark Lutz是有關Python方面的最早和最暢銷書籍的作者,并且從1992年起就是Python社區(qū)的先驅之一。同時他還是OReilly的《Programming Python》和《Python Pocket Reference》兩本書的作者。Mark從1997年開始教授Python課程,截至2007年已經指導了超過200次培訓。此外Mark擁有計算機科學學士和碩士學位,以及25年的軟件開發(fā)經驗。

圖書封面

圖書標簽Tags

評論、評分、閱讀與下載


    學習PYTHON 第三版(英文影印版) PDF格式下載


用戶評論 (總計0條)

 
 

 

250萬本中文圖書簡介、評論、評分,PDF格式免費下載。 第一圖書網 手機版

京ICP備13047387號-7