The Quick Python Book, 3rd Edition

所需积分/C币:10 2018-12-25 21:24:00 9.85MB PDF
收藏 收藏

This third revision of Manning’s popular The Quick Python Book offers a clear, crisp updated introduction to the elegant Python programming language and its famously easy-to-read syntax. Written for programmers new to Python, this latest edition includes new exercises throughout. It covers features common to other languages concisely, while introducing Python’s comprehensive standard functions library and unique features in detail. Foreword by Nicholas Tollervey, Python Software Foundation.
The Quick Python book The Quick Python book THIRD EDITION NAOMI CEDER FOREWORD BY NICHOLAS TOLLERVEY MANNING SHELTER ISLAND For online information and ordering of this and other manning books, please visit For more information, please contact es Dep Manning publications co 20 Baldwin road POBoⅹ761 Shelter island. nY11964 o2018 by Manning Publications Co. All rights reserved No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps o Recognizing the importance of preserving what has been written, it is Manning's policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end Recognizing also our responsibility to conserve the resources of our planet, Manning bool are printed on paper that is at least 15 percent recycled and processed without the use of elemental chlorine Manning publications co Development editor: Christina Taylor 20 Baldwin Road Technical development editor: Scott Steinman PO Box 761 Project Manager: Janet Vail Shelter island.nY11964 Copyeditor Kathy simpson Proofreader: Elizabeth martin Technical proofreader: Andre brito Typesetter and cover design: Marja Tudor ISBN9781617294037 Printed in the united states of america 12345678910-EBM-232221201918 brief contents PARTI STARTING OUT 1■ about path 2 Getting started 11 8 The Quick Python overview 20 PART 2 THE ESSENTIALS 35 4 The absolute basics 37 Lists, tuples, and sets 49 Strings 68 7 Dictionaries 89 Control flow 99 Functions 113 0 Modules and scoping rules 127 1 Python programs 142 12 USing the filesystem 158 18 Reading and writing files 175 14■ Exceptions190 PART 3 ADVANCED LANGUAGE FEATURES 205 15 Classes and object-oriented programming 207 16 Regular expressions 231 BRIEF CONTENTS 17 Data types as objects 241 18 Pack 255 19 Using Python libraries 264 PART 4 WORKING WITH DATA 273 20 Basic file wrangling 275 Processing data files 283 9 Data over the network 300 23 Saving data 319 4 Exploring data 337 Case study 354 contents foreword xvii p preface xviii acknowledgments xix about this book xxi about the cover illustration xxvi PART 1 STARTING OUT 7 About Python 3 1 Why should I use Python? 3 1. 2 What Python does well 4 Python is easy to use 4 Python is expressive 4. Python is readable 5. Python is complete"batteries included"6 Python is cross-platform 6 Python is free 1. 3 What Python doesnt do as well 7 Python isn't the fastest language 7. Python doesn't have the Python doesn't use multiple processors well o apport o compile most libraries 7 Python doesn 't check variable types at time 8. Python doesn't have much mobile s 1.4 Why learn Python 3? 9 CONTENTS 2 Getting started II 2.1 Installing Python 12 2.2 Basic interactive mode and IDle 13 The basic interactive mode 13. The Idle integrated development environment 14 Choosing between basic interactive mode and IDLE 15 2.3 Using IDLE's Python shell window 15 2.4 Hello world 17 2.5 Using the interactive prompt to explore python 17 3 The Quick Python overview 20 3.1 Python synopsis 21 3.2 Built-in data types 21 Numbers21·Las23·7ples24· Strings25 Dictionaries 26 Sets 26 File objects 27 8. 3 Control flow structures 28 Boolean values and expressions 28 The if-elif -else statement 28 The while loop 28 The for loop 29- Function definition 29 Exceptions 30- Context handling using the with keyword 31 8.4 Module creation 31 3.5 Object-oriented programming 32 PART 2 THE ESSENTIALS 35 The absolute basics 37 4.1 Indentation and block structuring 97 4.2 Differentiating comments 39 4.3 Variables and assignments 39 4.4 Expressions 41 4.5 Strings 42 4.6 Numbers 43 Built-in numeric functions 44 Advanced numeric functions44.Numericcomputation44.complex numbers 44 Advanced complex-number functions 45 4.7 The None value 46 4.8 Getting input from the user 46

试读 127P The Quick Python Book, 3rd Edition
限时抽奖 低至0.43元/次
身份认证后 购VIP低至7折
关注 私信
The Quick Python Book, 3rd Edition 10积分/C币 立即下载
The Quick Python Book, 3rd Edition第1页
The Quick Python Book, 3rd Edition第2页
The Quick Python Book, 3rd Edition第3页
The Quick Python Book, 3rd Edition第4页
The Quick Python Book, 3rd Edition第5页
The Quick Python Book, 3rd Edition第6页
The Quick Python Book, 3rd Edition第7页
The Quick Python Book, 3rd Edition第8页
The Quick Python Book, 3rd Edition第9页
The Quick Python Book, 3rd Edition第10页
The Quick Python Book, 3rd Edition第11页
The Quick Python Book, 3rd Edition第12页
The Quick Python Book, 3rd Edition第13页
The Quick Python Book, 3rd Edition第14页
The Quick Python Book, 3rd Edition第15页
The Quick Python Book, 3rd Edition第16页
The Quick Python Book, 3rd Edition第17页
The Quick Python Book, 3rd Edition第18页
The Quick Python Book, 3rd Edition第19页
The Quick Python Book, 3rd Edition第20页

试读结束, 可继续阅读

10积分/C币 立即下载