Python基础教程第三版(英文版)

3星(超过75%的资源)
所需积分/C币:0 2017-09-15 09:16:08 5.96MB PDF
85
收藏 收藏
举报

Python基础教程第三版(英文版)Magnus Lie Hetland 经典Python书籍 英文版beginning from novice to professional third edition
Beginning python: From Novice to Professional agnus Lie Hetland Trondheim, Norway ISBN-13(pbk:978-1-484200292 ISBN-l3( electronic:978-1-4842-0028-5 DOI10.1007/978-1-48420028-5 Library of congress Control Number: 2017934891 Copyright o 2017 by Magnus Lie Hetland This work is subject to copyright All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse ofillustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights While the advice and information in this book are believed to be true and accurate at the date of publication neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein Managing Director: Welmoed Spahr Lead Editor: Steve anglin Development Editor: Matthew Moodie Technical reviewer: michael Thomas Coordinating Editor: Mark Powers Copy Editor: Kim Wimpsett Compositor: SPi Global Indexer: SPi Global Artist: SPi globa Cover image designed by Shutterstock Distributed to the book trade worldwide by Springer Science+ Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax(201)348-4505, e-mail orders-nyospringer sbm.com,orvisitwww.springeronline.comApressMedia,LlcisaCalifornialLcandthesolemember (owner) is Springer Science Business Media Finance Inc(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation Forinformationontranslationspleasee-mailrights@apress.com,orvisitwww.apress.com/us/services/ rights-permission press titles may be purchased in bulk for academic, corporate, or promotional use e Book versions and licenses are also available for most titles for more information reference our print and e book bulk sales web pageatwww.apress.com/bulk-sales Any source code or other supplementary material referenced by the author in this book is available to readers fordownloadorcloningatGithubviathebooksproductpagelocatedatwww.apress.com/9781484200292 Formoredetailedinformationpleasevisithttp://www.apress.com/us/services/source-code Printed on acid-free paper For kjersti and Tor. Contents at a glance About the author About the technical reviewer ■■■■■■■■■■■■口■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ XXVI Preface∴ ■■■■■■■■■■■ Introduction…Xxi Chapter 1: Instant hacking: The basics Chapter 2: Lists and tuples ma RRRRRIRRIIIRaIIIIRIIiian 25 Chapter 3: Working with Strings ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 45 Chapter4: Dictionaries: When indices wont0,…,,,,…,…,,,m59 Chapter 5: Conditionals, Loops, and Some Other Statements Chapter 6: Abstractionmmmmmmmm mmmm 101 Chapter 7: More Abstraction ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■口■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 129 Chapter 8: Exceptions meMBER a149 Chapter 9: Magic Methods, Properties, and lteratorsmmmmma. 163 Chapter 10: Batteries Included mmmmmmmamamma 195 Chapter 11: Filles and Stuff g241 Chapter 12: Graphical User Interfaces m mm mmammmnmamaan 253 Chapter 13: Database Support 261 Chapter 14: Network Programming n ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 273 Chapter 15: Python and the web ga289 Chapter 16: Testing, 1-2-3. m B BB B MBIR MBIRARBIR RBER RRIR RRIBaIIIaII IIa 307 CONTENTS AT A GLANC Chapter 17: Extending Python a 321 Chapter 18: Packaging Your Programs.mRna ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 337 Chapter19: Playful Programming…,…,,…,,,,,,…,,,,…,…343 Chapter20: Project: Instant Markup…,… 353 Chapter 21: Project 2: Painting a Pretty Picture mmammammmaammm 373 Chapter22 Project3: XML for a0 Ccasions,…,,…,,…,,383 Chapter 23: Project 4: In the News.mma. uu397 Chapter 24: Project 5: A virtual Tea Party 409 Chapter 25: Project 6: Remote Editing with cGI ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 425 Chapter26: Project7: Your own bulletin board,,,,…,,…,,…,,435 Chapter 27: Project 8: File Sharing with XML-RPC 451 Chapter 28: Project 9: File Sharing Il-Now with GUI! ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 467 Chapter 29: Project 10: Do-It-Yourself Arcade Game ammamamanaamaannaanm. 475 Appendix A: The short Version mmm 495 Appendix B: Python Reference nn n503 Indexu 519 Contents About the author About the technical reviewer ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ XXVI Preface∴ ■■■■■■■■■■■ Introduction…Xxi Chapter 1: Instant Hacking: The basics The Interactive Interpreter. Algo... What? 2 Numbers and Expressions 3 Hexadecimal octa| s and binary…… 5 Variables Statements 6 Getting Input from the User Functions 789 Modules cmath and Complex Numbers..................................... 10 Back to the future,,… Saving and Executing Your Programs Running Your Python Scripts from a command prompt…..,,…………13 Making Your Scripts Behave Like Normal Programs…..,.,.,.,……13 Comments Strings 14 Single-Quoted Strings and Escaping Quotes.......... 量日面日日日面日日日面日日日量日面日自日日面日 ,15 Concatenating Strings 16 CONTENTS String Representations, str and repr Long Strings, Raw Strings, and bytes 17 A Quick Summary 22 New Functions in This chapter…...,.........,,..,………,23 Chapter 2: Lists and Tuples ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 25 Sequence Overview 25 Common Sequence Operations 26 Indexing 26 Slicing 28 Adding Sequences…..,.….30 Multiplication Membership.,………32 Length, Minimum, and Maximum Lists: Python's Workhorse . The list functi0n…34 Basic List Operations 34 List meth0ds…36 Tuples: Immutable Sequences A Quick Summary. New Functions in This Chapter What now? ……44 Chapter 3: Working with Strings ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 5 Basic String operations.eameaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaaen String Formatting: The short version…......,,.,.,.,.,,,.,…,…,… 5朽4 String Formatting: The Long version Replacement Field Names 47 Basic conversions∴948 Width, Precision, and Thousands separators Signs, alignment, and zero CONTENT String Methods… 52 center 日面口 find….……………………………53 lower 1日 54 replace… 55 strip trans|ate∴56 Is My String A Quick Summary....……57 New Functions in This chapter.…… 58 What now? …58 Chapter 4: Dictionaries: When Indices Won't Do atsstanasaaaasaimnaanmnanim 59 Dictionary Uses… 59 Creating and Using Dictionaries. The dict function .agu. 60 Basic Dictionary operations 61 String Formatting with Dictionaries. Dictionary Methods A Quick Summary. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD ,70 New Functions in This chapter What now? 70 Chapter 5: Conditionals, Loops, and some other Statements a 71 More about print and import 71 Printing Multiple Arguments Importing Something as Something Else Assignment Magic 73 Sequence Unpacking……73 Chained assignments..………75 Augmented Assignments……,,… 75 IX CONTENTS BlockS: The Joy of Indentation 76 Conditions and conditional statements 76 So That's what those boolean values are for 6 Conditional execution and the if statement 面面a,日面面a日面面面,日面面量日面面面面a日面面量日面面面BB日面面量a面面面面日面a面面 78 else clauses …78 elif clauses 79 Nesting blocks..... More complex Conditi 84 00ps,15 while loops for Loops Iterating Over Dictionaries 87 Some iteration utilities 87 Breaking Out of Loops.........................89 else clauses in Loops. ...............................................................................................92 Comprehensions-Slightly Loopy 92 And three for the road 94 Nothing happened 94 Deleting with del 94 Executing and Evaluating Strings with exec and eval 96 A Quick Summary. 98 New Functions in This chapter What now?,… Chapter 6: Abstraction mmmmmmmmmm 101 Laziness is a virtue 101 Abstraction and structure 102 Creating your own Functions 102 Documenting Functions. 103 Functions That Aren't Really Functions…..,.,.,,,…,,……,104

...展开详情
试读 127P Python基础教程第三版(英文版)
立即下载 低至0.43元/次 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
ht3299429 还挺清晰的,非常感谢。
2019-01-17
回复
qq_23099219 还不错,比较喜欢
2018-10-27
回复
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
上传资源赚钱or赚积分
最新推荐
Python基础教程第三版(英文版) 0积分/C币 立即下载
1/127
Python基础教程第三版(英文版)第1页
Python基础教程第三版(英文版)第2页
Python基础教程第三版(英文版)第3页
Python基础教程第三版(英文版)第4页
Python基础教程第三版(英文版)第5页
Python基础教程第三版(英文版)第6页
Python基础教程第三版(英文版)第7页
Python基础教程第三版(英文版)第8页
Python基础教程第三版(英文版)第9页
Python基础教程第三版(英文版)第10页
Python基础教程第三版(英文版)第11页
Python基础教程第三版(英文版)第12页
Python基础教程第三版(英文版)第13页
Python基础教程第三版(英文版)第14页
Python基础教程第三版(英文版)第15页
Python基础教程第三版(英文版)第16页
Python基础教程第三版(英文版)第17页
Python基础教程第三版(英文版)第18页
Python基础教程第三版(英文版)第19页
Python基础教程第三版(英文版)第20页

试读结束, 可继续阅读

0积分/C币 立即下载 >