1. Trang chủ
  2. » Tất cả

73093259-Learning-Python-Fourth-Edition

1,2K 5 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 1.214
Dung lượng 15,51 MB

Nội dung

Learning Python FOURTH EDITION Learning Python Mark Lutz Beijing • Cambridge • Farnham • Köln • Sebastopol • Taipei • Tokyo Learning Python, Fourth Edition by Mark Lutz Copyright © 2009 Mark Lutz All rights reserved Printed in the United States of America Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472 O’Reilly books may be purchased for educational, business, or sales promotional use Online editions are also available for most titles (http://my.safaribooksonline.com) For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com Editor: Julie Steele Production Editor: Sumita Mukherji Copyeditor: Rachel Head Production Services: Newgen North America Indexer: John Bickelhaupt Cover Designer: Karen Montgomery Interior Designer: David Futato Illustrator: Robert Romano Printing History: March 1999: December 2003: October 2007: September 2009: First Edition Second Edition Third Edition Fourth Edition Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc Learning Python, the image of a wood rat, and related trade dress are trademarks of O’Reilly Media, Inc Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein ISBN: 978-0-596-15806-4 [M] 1252944666 To Vera You are my life Table of Contents Preface xxxi Part I Getting Started A Python Q&A Session Why Do People Use Python? Software Quality Developer Productivity Is Python a “Scripting Language”? OK, but What’s the Downside? Who Uses Python Today? What Can I Do with Python? Systems Programming GUIs Internet Scripting Component Integration Database Programming Rapid Prototyping Numeric and Scientific Programming Gaming, Images, Serial Ports, XML, Robots, and More How Is Python Supported? What Are Python’s Technical Strengths? It’s Object-Oriented It’s Free It’s Portable It’s Powerful It’s Mixable It’s Easy to Use It’s Easy to Learn It’s Named After Monty Python How Does Python Stack Up to Language X? 5 7 9 10 10 11 11 11 12 12 13 13 13 14 15 16 16 17 17 17 vii Chapter Summary Test Your Knowledge: Quiz Test Your Knowledge: Answers 18 19 19 How Python Runs Programs 23 Introducing the Python Interpreter Program Execution The Programmer’s View Python’s View Execution Model Variations Python Implementation Alternatives Execution Optimization Tools Frozen Binaries Other Execution Options Future Possibilities? Chapter Summary Test Your Knowledge: Quiz Test Your Knowledge: Answers 23 24 24 26 29 29 30 32 33 33 34 34 34 How You Run Programs 35 The Interactive Prompt Running Code Interactively Why the Interactive Prompt? Using the Interactive Prompt System Command Lines and Files A First Script Running Files with Command Lines Using Command Lines and Files Unix Executable Scripts (#!) Clicking File Icons Clicking Icons on Windows The input Trick Other Icon-Click Limitations Module Imports and Reloads The Grander Module Story: Attributes import and reload Usage Notes Using exec to Run Module Files The IDLE User Interface IDLE Basics Using IDLE Advanced IDLE Tools Other IDEs Other Launch Options viii | Table of Contents 35 37 38 39 41 42 43 44 46 47 47 49 50 51 53 56 57 58 58 60 62 63 64

Ngày đăng: 13/04/2019, 01:33