Python cookbook by david beazley brian k jones

Python Cookbook

If you need help writing programs in Python 3, or want to update older Python 2 code, this book is just the ticket. Packed with practical recipes written and tested with Python 3.3, this unique cookbook is for experienced Python programmers who want to focus on modern tools and idioms.

Inside, you’ll find complete recipes for more than a dozen topics, covering the core Python language as well as tasks common to a wide variety of application domains. Each recipe contains code samples you can use in your projects right away, along with a discussion about how and why the solution works.

Data Structures and Algorithms
Strings and Text
Numbers, Dates, and Times
Iterators and Generators
Files and I/O
Data Encoding and Processing
Functions
Classes and Objects
Metaprogramming
Modules and Packages
Network and Web Programming
Concurrency
Utility Scripting and System Administration
Testing, Debugging, and Exceptions
C Extensions

First published July 15, 2002

About the author

Profile Image for David Beazley.

David Beazley

Ratings & Reviews

Friends & Following

Community Reviews

Profile Image for Sean.

Lots of practical recipes for using Python more effectively.

Just to clarify for certain of my friends (you know who you are!):
* Python is a popular computer language, named after «Monty Python’s Flying Circus», a British TV comedy
* The O’Reilly Cookbook series uses the metaphor of cooking to present a collection of small, practical solutions («recipes») to specific programming problems.

Hence, despite my misleading lead-in, the Python Cookbook has nothing to do with preparing snakes for human consumption.

As a Java programmer that wants to learn Python this book was OK.
There are some good recipes but most of the book (about 85%) can be summarized in one sentence «You want to do some job, find third party library to do it for you»
Especially annoying that in some recipes the section ends with something like «there are some better libraries to do this job so use them and not the suggested in recipe. «
Some of the recipes are very basic and can be summarized in few lines but in many cases those recipes are stretched to a few pages.

Profile Image for Louis.

The third edition of Python Cookbook is part of what seems to be a general trend of issuing new editions focusing on Python 3. For me, whose focus is on data analysis and technical computing, this is the time to be thinking about the change from Python 2 to Python 3 as the base libraries of Numpy, Scipy, Matplotlib, and iPython have been ported, and the various other libraries I use that depend on these are being ported as well. But this edition is not just porting the old cookbook, it is a complete rewrite to go with the big shift that was Python 2 to 3. Because a lot of what I used the old cookbook and many of the recipes at the ActiveState website was for handling issues related to crossing versions (I had some projects with Jython, which was several versions behind CPython) and ways of getting around issues that are purportedly solved in Python 3. For that the third edition of Python Cookbook fills its purpose of showing idiomatic ways of performing some programming tasks, and being a reference for how to do thing well and elegantly taking advantage of the language and libraries, not fighting it.

Читайте также:  Внедрение зависимостей через конструктор java

I focus on using Python as a data analysis platform. So I generally only learned as much of the language I needed to in order to use the scientific stack of Numpy, Scipy, Matplotlib, Pandas, and the libraries that were built around them. But that means that I have not gotten to know large portions of the standard library. And introductory books don’t cover this either, they focus on using the language itself. There are also a large number of books and references that focus on Python as a web development tool or a system administration tool, so those parts of the standard library get a lot of coverage in teaching materials. But the rest you almost have to stumble upon. In ideal conditions, the way you would learn about much of the standard library is to have someone who was more experienced nearby show you what you needed to know, as she demonstrated methods in her code that did the things that you never learned in class. But sometimes there is no such person. The Python Cookbook plays this role, of demonstrating how to do things in Python 3 that are practical and you probably would not learn while learning the language itself.

Some areas that I found useful are the heapq, generators, and the I/O. heapq is a module and data structure I just never got around to learning. Usually discussions about Python data structures made their way to deque and heapq was discussed by reference. But after looking at the priority queue discussion, I fired up an iPython notebook and went through every recipe that used heapq and I’ve started thinking about how to rewrite a model I recently coded up. Generators and File I/O are areas that I knew in passing through my use with them in data analysis, but Python Cookbook opened up new ways of understanding (I am starting to get why JSON is so useful). Now, there is nothing special about these, but seeing these parts of the standard library in use in an elegant way is something beyond what you would get from a module documentation or a standard tutorial.

Читайте также:  Javascript the form submit

I do miss the introductions to each chapter that was in the 1st and 2nd editions of Python Cookbook. But what Python Cookbook does give is an idiomatic feel of using Python3, when there are not all that many mentors out there to go around. So this is something very useful for others who are starting to use Python 3. It is not for learning the language, but it is for using the language well.

Disclaimer: I received a free electronic copy of this book as part of the Oreilly Bloggers program

Источник

Python Cookbook, Beazley D., Jones B.K., 2013

Since 2008, the Python world has been watching the slow evolution of Python 3. It was always known that the adoption of Python 3 would likely take a long time. In fact, even at the time of this writing (2013), most working Python programmers continue to use Python 2 in production. A lot has been made about the fact that Python 3 is not backward compatible with past versions. To be sure, backward compatibility is an issue for anyone with an existing code base. However, if you shift your view toward the future, you’ll find that Python 3 offers much more than meets the eye.

Python Cookbook, Beazley D., Jones B.K., 2013

Who This Book Is For.

This book is aimed at more experienced Python programmers who are looking to deepen their understanding of the language and modern programming idioms. Much of the material focuses on some of the more advanced techniques used by libraries, frameworks, and applications. Throughout the book, the recipes generally assume that the reader already has the necessary background to understand the topic at hand (e.g., general knowledge of computer science, data structures, complexity, systems programming, concurrency, С programming, etc.). Moreover, the recipes are often just skeletons that aim to provide essential information for getting started, but which require the reader to do more research to fill in the details. As such, it is assumed that the reader knows how to use search engines and Pythons excellent online documentation.

Table of Contents.

Preface.
1. Data Structures and Algorithms.
2. Strings and Text.
3. Numbers. Dates, and Times.
4. Iterators and Generators.
5. Files and I/O.
6. Data Encoding and Processing.
7. Functions.
8. Classes and Objects.
9. Metaprogramming.
10. Modules and Packages.
11. Network and Web Programming.
12. Concurrency.
13. Utility Scripting and System Administration.
14. Testing, Debugging, and Exceptions.
15. С Extensions.
A. Further Reading.
Index.

Читайте также:  Run terminal from java

Бесплатно скачать электронную книгу в удобном формате, смотреть и читать:
Скачать книгу Python Cookbook, Beazley D., Jones B.K., 2013 — fileskachat.com, быстрое и бесплатное скачивание.

Скачать pdf
Ниже можно купить эту книгу по лучшей цене со скидкой с доставкой по всей России. Купить эту книгу

Источник

Python Cookbook, Beazley D., Jones B.K., 2013

Since 2008, the Python world has been watching the slow evolution of Python 3. It was always known that the adoption of Python 3 would likely take a long time. In fact, even at the time of this writing (2013), most working Python programmers continue to use Python 2 in production. A lot has been made about the fact that Python 3 is not backward compatible with past versions. To be sure, backward compatibility is an issue for anyone with an existing code base. However, if you shift your view toward the future, you’ll find that Python 3 offers much more than meets the eye.

Python Cookbook, Beazley D., Jones B.K., 2013

Who This Book Is For.

This book is aimed at more experienced Python programmers who are looking to deepen their understanding of the language and modern programming idioms. Much of the material focuses on some of the more advanced techniques used by libraries, frameworks, and applications. Throughout the book, the recipes generally assume that the reader already has the necessary background to understand the topic at hand (e.g., general knowledge of computer science, data structures, complexity, systems programming, concurrency, С programming, etc.). Moreover, the recipes are often just skeletons that aim to provide essential information for getting started, but which require the reader to do more research to fill in the details. As such, it is assumed that the reader knows how to use search engines and Pythons excellent online documentation.

Table of Contents.

Preface.
1. Data Structures and Algorithms.
2. Strings and Text.
3. Numbers. Dates, and Times.
4. Iterators and Generators.
5. Files and I/O.
6. Data Encoding and Processing.
7. Functions.
8. Classes and Objects.
9. Metaprogramming.
10. Modules and Packages.
11. Network and Web Programming.
12. Concurrency.
13. Utility Scripting and System Administration.
14. Testing, Debugging, and Exceptions.
15. С Extensions.
A. Further Reading.
Index.

Бесплатно скачать электронную книгу в удобном формате, смотреть и читать:
Скачать книгу Python Cookbook, Beazley D., Jones B.K., 2013 — fileskachat.com, быстрое и бесплатное скачивание.

Скачать pdf
Ниже можно купить эту книгу по лучшей цене со скидкой с доставкой по всей России. Купить эту книгу

Источник

Оцените статью