20本最好的免费的Python书籍

jopen 11年前

想要学习Python编程语言的读者有大量相关书籍可供选择,有印刷版也有电子版,而Python是一门开源的编译语言,开发者也提供了不少免费可自由下载的Python电子书。本文挑选其中最优秀的 20本 Python电子书,内容覆盖了Python的一般介绍,游戏开发,编程技巧,儿童编程学习等类别,它们大多数都采用了创作共用署名非商业许可证,如《T hink Python》、《 Invent Your Own Computer Games with Python》、《 笨方法学 Python第二版》、《 Natural Language Processing with Python》等。

1. Think Python

20本最好的免费的Python书籍
Website www.greenteapress.com/thinkpython/thinkpython.html
Author Allen B. Downey
Format PDF, Postscript, LaTeX, HTML EPUB
Pages 234

Think Python is a concise and gentle introduction to software design using the Python programming language. Intended for would-be developers with no programming experience. This book starts with the most basic concepts and gradually adds new material at a pace that is comfortable to the reader.

This book providing a wealth of information on:

  • Variables, expressions and statements
  • Functions
  • Conditionals and recursion
  • Fruitful functions
  • Interation
  • Strings
  • Lists
  • Dictionaries
  • Tuples - ordered list of elements
  • Files
  • Classes and objects / Classes and functions / Classes and methods
  • Inheritance
  • Case studies on interface design, word play, data structure selection, and Tkinter

It is available under the Creative Commons Attribution-NonCommercial 3.0 Unported License.

</td> </tr> </tbody> </table>

2. Invent Your Own Computer Games with Python

20本最好的免费的Python书籍
Website inventwithpython.com
Author Albert Sweigart
Format PDF
Pages 436

Invent Your Own Computer Games with Python teaches you computer programming in the Python programming language. Each chapter gives you the complete source code for a new game and teaches the programming concepts from these examples.

The book is available under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 license. Invent with Python was written to be understandable by kids as young as 10 to 12 years old, although it is suitable for any age.

This second edition has revised and expanded content, including using the Pygame library to make games with graphics, animation, and sound.

The book focuses on three different areas:

  • Series of tutorials ranging from a simple "guess the number" game, to drawing game boards with ASCII art, reversi, and simple artifical intelligence simulation
  • Make the design for a Hangman game
  • Learn new methods and functions that come with Python
  • Simple mathematical concepts including cartesian coordinate systems, X-axis and Y-axis, the commutative property of addition, and absolute values and the abs () function
  • Use the Pygame library to make games with graphics, animation, mouse input, and sound
  • Make graphical user interface programs that have graphics and can accept input from the keyboard and mouse
</td> </tr> </tbody> </table>

3. Snake Wrangling for Kids

20本最好的免费的Python书籍
Website www.briggs.net.nz/snake-wrangling-for-kids.html
Author Jason R. Briggs
Format PDF
Pages 150

Snake Wrangling for Kids is a printable electronic book, for children 8 years and older, who would like to learn computer programming. It covers the very basics of programming, and uses the Python 3 programming language to teach the concepts.

There are 3 different versions of the free book (one for Mac, one for Linux and one for Windows). There have been around 50,000 downloads, as of 2012. It has been rewritten and updated, with new chapters (including developing graphical games), and new code examples

This version is licensed under the Creative Commons license.

  • Use fundamental data structures like lists, tuples, and maps
  • Organize and reuse your code with functions and modules
  • Use control structures like loops and conditional statements
  • Draw shapes and patterns with Python's turtle module
  • Create games, animations, and other graphical wonders with Tkinter
</td> </tr> </tbody> </table>

4. Learn Python the Hard Way, 2nd Edition

20本最好的免费的Python书籍
Website learnpythonthehardway.org
Author Zed Shaw
Format HTML
Pages 183

This simple book is meant to give you a first start in programming.

The title says it is the hard way to learn to write code but it is actually not. It is the hard way only in that it is the way people used to teach things. In this book you will do something incredibly simple that all programmers actually do to learn a language.

This is a very beginner book for people who want to learn to code. If you can already code then look elsewhere. It is targeted for newbies to build up their skills before starting a more detailed book. The 2nd Edition features 5 new exercises, fixes and updates to nearly every exercise, and three of the new exercises teach you to create a simple web application as the final part of the book.

The book consists of:

  • 52 Exercises which consist of typing code samples. This helps budding Python programmers to learn the names of the symbols, become familiar with typing them, and reading the language
  • Exercises cover topics such as: Variables, printing, functions, boolean algebra, branches and functions, automated testing, and starting your own game
</td> </tr> </tbody> </table>

5. Natural Language Processing with Python

20本最好的免费的Python书籍
Website nltk.org/book/
Author Steven Bird, Ewan Klein, and Edward Loper
Format PDF, Ebook, HTML
Pages 504

Natural Language Processing with Python - Analyzing Text with the Natural Language Toolkit offers a highly accessible introduction to natural language processing, the field that supports a variety of language technologies, from predictive text and email filtering to automatic summarization and translation. Learn how to write Python programs that work with large collections of unstructured text. Access richly annotated datasets using a comprehensive range of linguistic data structures, and understand the main algorithms for analyzing the content and structure of written communication.

This book is made available under the terms of the Creative Commons Attribution Noncommercial No-Derivative-Works 3.0 US License.

This book helps to:

  • Extract information from unstructured text, either to guess the topic or identify "named entities"
  • Analyze linguistic structure in text, including parsing and semantic analysis
  • Access popular linguistic databases, including WordNet and treebanks
  • Integrate techniques drawn from fields as diverse as linguistics and artificial intelligence
</td> </tr> </tbody> </table>

6. Building Skills in Python

20本最好的免费的Python书籍
Website www.itmaybeahack.com/homepage/books/python.html
Author Steven F. Lott
Format PDF, HTML
Pages 574

This 47 chapter book will help you build Python programming skills through a series of exercises. It includes six projects from straightforward to sophisticated that will help solidify your Python skills.

This book is a close-to-complete presentation of the Python language, updated to cover Python 2.6 and some elements of Python 3.1. It is oriented toward learning, which involves accumulating many closely intertwined concepts. This book is primarily targeted at professional programmers.

The book explores a wide range of topics including:

  • Numeric Expressions and Output
  • Advanced Expressions
  • Variables, Assignment and Input
  • Truth, Comparison and Conditional Processing
  • Loops and Iterative Procssing
  • Functions

This book is made available under a Creative Commons Attribution-Noncommercial-No Derivative Works License.

</td> </tr> </tbody> </table>

7. Dive into Python

20本最好的免费的Python书籍
Website www.diveintopython.net
Author Mark Pilgrim
Format PDF, HTML, Word 97, Plain Text, HTML (single file), XML, Build scripts
Pages 327

Dive Into Python is a hands-on guide to the Python language. Each chapter starts with a real, complete code sample, proceeds to pick it apart and explain the pieces, and then puts it all back together in a summary at the end.

Explores:

  • Native Datatypes
  • The Power of Introspection
  • Objects and Object-Orientation
  • Exceptions and File Handling
  • Regular Expressions
  • HTML Processing
  • XML Processing
  • Scripts and Streams
  • HTTP Web Services
  • SOAP Web Services
  • Unit Testing
  • Refactoring
  • Functional Programming
  • Dynamic Functions
  • Performance Tuning

This book is licensed under the terms of the GNU Free Documentation License, Version 1.1 or any later version.

</td> </tr> </tbody> </table>

8. Text Processing in Python

20本最好的免费的Python书籍
Website gnosis.cx/TPiP/
Author David Mertz
Format Smart ASCII format
Pages 544

Text Processing in Python describes techniques for manipulation of text using the Python programming language. At the broadest level, text processing is simply taking textual information and doing something with it. This might be restructuring or reformatting it, extracting smaller bits of information from it, or performing calculations that depend on the text.

Text processing is arguably what most programmers spend most of their time doing. Because Python is clear, expressive, and object-oriented it is a perfect language for doing text processing, even better than Perl. As the amount of data everywhere continues to increase, this is more and more of a challenge for programmers.

This book is not a tutorial on Python. The author provides practical pointers and tips that emphasize efficent, flexible, and maintainable approaches to the text processing tasks that working programmers face daily.

Text Processing in Python begins with an introduction to text processing and contains a quick Python tutorial to get you up to speed. It then delves into essential text processing subject areas, including string operations, regular expressions, parsers and state machines, and Internet tools and techniques. Appendixes cover such important topics as data compression and Unicode.

This book is copyright to Addison Wesley but can be downloaded without charge.

</td> </tr> </tbody> </table>

9. The Standard Python Library

20本最好的免费的Python书籍
Website effbot.org/zone/librarybook-index.htm
Author Fredrik Lundh
Format PDF, Single chapter PDFs, HTML
Pages 300

The Standard Python Library is a guide for serious Python programmers. It offers accurate, author-tested documentation of all the modules in the Python 2.0 Library, together with over 300 annotated example scripts using the modules.

The book has chapters on:

  • Standard and Core Modules
  • Threads and Processes
  • Data Representation
  • File Formats
  • Mail and News Messages
  • Network Protocols
  • Internationalization
  • Multimedia Modules
  • Data Storage
  • Tools and Utilities
  • Platform Specific Modules
  • Implementation Support Modules
  • Other Modules

This is an electronic edition which is based on the second edition published by O'Reilly in 2001.

</td> </tr> </tbody> </table>

10. The Definitive Guide to Pylons

20本最好的免费的Python书籍
Website pylonsbook.com/en/1.1/
Author James Gardner
Format PDF, HTML
Pages 568

Pylons is a lightweight web framework built on standard Python tools that provides a robust environment for writing modern web applications. It is well known for its clean architecture and loosely coupled approach, both of which make web development fast, flexible, and easy.

The Definitive Guide to Pylons teaches you everything you need to know about web development with Pylons - from how to create your first "Hello World!" application to how to use each of Pylons’ core tools including FormEncode, Mako, SQLAlchemy, and Routes to how to perform more advanced tasks such as testing, using Unicode, internationalizing your application, authenticating users, and more.

It also helps developers make use of the software's built-in support for session management, web services, and Ajax.

This book is made available under the terms of the GNU Free Documentation License, Version 1.2 or any later version.

</td> </tr> </tbody> </table>

11. Making Games with Python & Pygame

20本最好的免费的Python书籍
Website inventwithpython.com/pygame/index.html
Author Al Sweigart
Format PDF, HTML, Mobi
Pages 365

This book teaches you how to make graphical computer games in the Python programming language using the Pygame library. It is targeted at the intermediate programmer.

The book features the source code to 11 games. Each chapter focuses on a single game program, explaining how different parts of the code work. The games are clones of classics such as Nibbles, Tetris, Simon, Bejeweled, Othello, Ink Spill, Connect Four, Flood It, and others. The programs are less than 600 lines long.

The book and the programs are open source, and are available under a Creative Commons Attribution-Noncommercial-Share Alike license.

</td> </tr> </tbody> </table>

12. Python Module of the Week

20本最好的免费的Python书籍
Website www.doughellmann.com/PyMOTW/index.html
Author Doug Hellmann
Format PDF, HTML
Pages 953

Python Module of the Week (PyMOTW) is a series of blog posts written by Doug Hellmann. It was started as a way to build the habit of writing something on a regular basis. The focus of the series is building a set of example code for the modules in the Python standard library.

PyMOTW is a good source of documentation for Python modules.

PyMOTW includes a command line program, motw, to make it easier to access the examples while you are developing.

This work is made available under the terms of the Creative Commons Attribution-NonCommercial Share-alike 3.0 license.

</td> </tr> </tbody> </table>

13. A Byte of Python

20本最好的免费的Python书籍
Website www.swaroopch.com/notes/python/
Author Swaroop C H
Format PDF, HTML, Full source
Pages 120

A Byte of Python is a free book on programming using the Python language. It serves as a tutorial or guide to the Python language for a beginner audience.

This book is written for the latest Python 3.

This book is released under the Creative Commons Attribution-NonCommercial-ShareAlike License 3.0

Topics covered include:

  • Basics of Python
  • Operators and Expressions
  • Control Flow
  • Functions
  • Modules
  • Data Structures
  • Problem Solving
  • Object Oriented Programming
  • Input Output
  • Exceptions
  • Standard Library
</td> </tr> </tbody> </table>

14. Think Complexity

20本最好的免费的Python书籍
Website greenteapress.com/complexity/html/jndex.html
Author Allen B. Downey
Format PDF, HTML
Pages 148

This book is about data structures and algorithms, intermediate programming in Python, computational modeling and the philosophy of science:

Topics covered include:

  • Graphs including random and connected graphs
  • Analysis of algorithms - the branch of computer science that considers the performance of algorithms
  • Small world graphs
  • Scale-free networks: Zipf's law, cumulative, continuous and Pareto distributions
  • Cellular automata
  • Game of Life
  • Fractals
  • Self-organized criticality
  • Case studies
</td> </tr> </tbody> </table>

15. Data Structures and Algorithms with Object-Oriented Design Patterns in Python

20本最好的免费的Python书籍
Website www.brpreiss.com/books/opus7/html/book.html
Author Bruno R. Preiss
Format PDF (not available in the public domain), HTML
Pages 557

This book is about the fundamentals of data structures and algorithms - the basic elements from which large and complex software artifacts are built. To develop a solid understanding of a data structure requires three things:

  • Learn how the information is arranged in the memory of the computer
  • Become familar with the algorithms for manipulating the information contained in the data structure
  • Understand the performance characteristics of the data structure so that when called upon to select a suitable data structure for a particular application

This book also illustrates object-oriented design and it promotes the use of common, object-oriented design patterns. The algorithms and data structures in the book are presented in the Python programming language. Virtually all the data structures are presented in the context of a single class hierarchy.

</td> </tr> </tbody> </table>

16. Programming Computer Vision with Python

20本最好的免费的Python书籍
Website programmingcomputervision.com
Author Jan Erik Solem
Format PDF
Pages 300

This book gives a hands-on introduction to the underlying theory and algorithms of computer vision (images, videos, etc). It seeks to explain computer vision in simple terms, without becoming too embroiled in theory. You will learn techniques for object recognition, 3D reconstruction, stereo imaging, augmented reality, and other computer vision applications as you follow clear examples written in Python. There are complete code samples with accompanying explanations.

The Python language compes with many powerful modules for handling images, mathematical computing and data mining.

The final draft of the book is released under a Creative Commons license.

Topics covered include:

  • Learn techniques used in robot navigation, medical image analysis, and other computer vision applications
  • Work with image mappings and transforms, such as texture warping and panorama creation
  • Compute 3D reconstructions from several images of the same scene
  • Organize images based on similarity or content, using clustering methods
  • Build efficient image retrieval techniques to search for images based on visual content
  • Use algorithms to classify image content and recognize objects
  • Access the popular OpenCV library through a Python interface
</td> </tr> </tbody> </table>

17. Python for you and me 0.2

20本最好的免费的Python书籍
Website kushal.fedorapeople.org/book/
Author Kushal Das
Format PDF, HTML
Pages 70

This book is designed for newcomers to the Python programming language. It is released under the GNU Free Documentation License v1.2 or later.

Topics covered include:

  • Variables and Datatypes
  • Operators and expressions
  • Control flow
  • Looping
  • Data structures
  • Strings
  • Functions
  • File handling
  • Class
  • Modules
  • Collections module
  • Virtual Python Environment builder
</td> </tr> </tbody> </table>

18. Problem Solving with Algorithms and Data Structures using Python

20本最好的免费的Python书籍
Website interactivepython.org/courselib/static/pythonds/index.html
Author Bradley W. Miller and David L. Ranum
Format HTML
Pages 432

This textbook is designed to serve as a text for a first course on data structures and algorithms, typically taught as the second course in the computer science curriculum.

The objectives of this book are:

  • To review the ideas of computer science, programming, and problem-solving
  • To understand abstraction and the role it plays in the problem-solving process
  • To understand and implement the notion of an abstract data type
  • To review the Python programming language