Python编程入门教程:从'A Byte of Python'看Python 3.0

需积分: 33 37 下载量 114 浏览量 更新于2024-07-21 1 收藏 604KB PDF 举报
"《A Byte of Python》英文版是一本针对初学者的Python编程教程,由开源mwlib toolkit生成。该教程适用于希望入门Python语言的人群,无论是对计算机基础知识有一定了解,仅知道如何保存文本文件,还是希望学习最新Python 3.0版本的读者。原版针对Python 2.x的教程已更新至Python 3.0,对于仍在使用Python 2.x的读者,可以下载之前的版本[5]。 该书以简洁的方式介绍了Python语言的基本概念,旨在帮助新手逐步掌握编程技能。书中不仅包含了基础语法、数据类型、控制结构、函数、模块等内容,还涵盖了面向对象编程和异常处理等主题。作者将复杂的概念通过易于理解的实例讲解,使读者能够快速上手。 反馈表明,《A Byte of Python》深受读者喜爱,被赞誉为最佳入门教程之一。例如,Walt Michalik评价说:“这是我见过的最好的初学者教程,非常感谢您的努力。”这本书不仅适合自学,也常被教育机构和教师用作教学资源。 如果你对Python感兴趣,无论你是选择学习Python 2.x还是3.0,这本书都能提供一个坚实的基础。同时,考虑到技术发展,建议关注Python 3.x的学习,因为它具有更现代的特性和更好的长期支持。James Bennett的文章[6]可能有助于你做出选择,权衡两者之间的差异和优势。 《A Byte of Python》是一本实用且友好的Python入门指南,无论是在线阅读PDF[2]或购买实体书[4],都能让你在探索编程世界的第一步中受益匪浅。"
2013-09-16 上传
this is a book about python. it was written by Swaroop C H.its name is "a byte of python". Table of Contents Preface Who This Book Is For History Lesson Status of the book Official Website License Terms Using the interpreter prompt Choosing an Editor Using a Source File Output How It Works Executable Python programs Getting Help Summary 4. The Basics Literal Constants Numbers Strings Variables Identifier Naming Data Types Objects Output How It Works Logical and Physical Lines Indentation Summary 5. Operators and Expressions Introduction Operators Operator Precedence Order of Evaluation Associativity Expressions Using Expressions Summary 6. Control Flow Introduction The if statement ivUsing the if statement How It Works The while statement Using the while statement The for loop Using the for statement Using the break statement The continue statement Using the continue statement Summary 7. Functions Introduction Defining a Function Function Parameters Using Function Parameters Local Variables Using Local Variables Using the global statement Default Argument Values Using Default Argument Values Keyword Arguments Using Keyword Arguments The return statement Using the literal statement DocStrings Using DocStrings Summary 8. Modules Introduction Using the sys module Byte-compiled .pyc files The from..import statement A module's __name__ Using a module's __name__ Making your own Modules Creating your own Modules from..import The dir() function Using the dir function Summary 9. Data Structures Introduction List Quick introduction to Objects and Classes Using Lists Tuple Using Tuples Tuples and the print statement Dictionary Using Dictionaries Sequences Using Sequences References Objects and References More about Strings String Methods Summary 10. Problem Solving - Writing a Python Script The Problem The Solution First Version Second Version Third Version Fourth Version More Refinements The Software Development Process Summary 11. Object-Oriented Programming Introduction The self Classes Creating a Class object Methods Using Object Methds The __init__ method Using the __init__ method Class and Object Variables Using Class and Object Variables Inheritance Using Inheritance Summary 12. Input/Output Files Using file Pickle Pickling and Unpickling Summary 13. Exceptions Errors Try..Except Handling Exceptions Raising Exceptions How To Raise Exceptions Try..Finally Using Finally Summary 14. The Python Standard Library Introduction The sys module Command Line Arguments More sys The os module Summary 15. More Python Special Methods Single Statement Blocks List Comprehension Using List Comprehensions Receiving Tuples and Lists in Functions Lambda Forms Using Lambda Forms The exec and eval statements The assert statement The repr function Summary 16. What Next? Graphical Software Summary of GUI Tools Explore More Summary A. Free/Libré and Open Source Software (FLOSS) B. About Colophon About the Author C. Revision History Timestamp