Mastering Python

0
(0)

Mastering Python
 

  • Author:Rick van Hattem
  • Length: 486 pages
  • Edition: 1
  • Publisher: Packt Publishing
  • Publication Date: 2016-04-29
  • ISBN-10: 1785289721
  • ISBN-13: 9781785289729
  • Sales Rank: #132020 (See Top 100 Books)
  • Download:Register/Login to Download
  • Buy Print:Buy from amazon


    Book Description

    Master the art of writing beautiful and powerful Python by using all of the features that Python 3.5 offers

    About This Book

    • Become familiar with the most important and advanced parts of the Python code style
    • Learn the trickier aspects of Python and put it in a structured context for deeper understanding of the language
    • Offers an expert’s-eye overview of how these advanced tasks fit together in Python as a whole along with practical examples

    Who This Book Is For

    Almost anyone can learn to write working script and create high quality code but they might lack a structured understanding of what it means to be ‘Pythonic’. If you are a Python programmer who wants to code efficiently by getting the syntax and usage of a few intricate Python techniques exactly right, this book is for you.

    What You Will Learn

    • Create a virtualenv and start a new project
    • Understand how and when to use the functional programming paradigm
    • Get familiar with the different ways the decorators can be written in
    • Understand the power of generators and coroutines without digressing into lambda calculus
    • Create metaclasses and how it makes working with Python far easier
    • Generate HTML documentation out of documents and code using Sphinx
    • Learn how to track and optimize application performance, both memory and cpu
    • Use the multiprocessing library, not just locally but also across multiple machines
    • Get a basic understanding of packaging and creating your own libraries/applications

    In Detail

    Python is a dynamic programming language. It is known for its high readability and hence it is often the first language learned by new programmers. Python being multi-paradigm, it can be used to achieve the same thing in different ways and it is compatible across different platforms. Even if you find writing Python code easy, writing code that is efficient, easy to maintain, and reuse is not so straightforward.

    This book is an authoritative guide that will help you learn new advanced methods in a clear and contextualised way. It starts off by creating a project-specific environment using venv, introducing you to different Pythonic syntax and common pitfalls before moving on to cover the functional features in Python. It covers how to create different decorators, generators, and metaclasses. It also introduces you to functools.wraps and coroutines and how they work. Later on you will learn to use asyncio module for asynchronous clients and servers. You will also get familiar with different testing systems such as py.test, doctest, and unittest, and debugging tools such as Python debugger and faulthandler. You will learn to optimize application performance so that it works efficiently across multiple machines and Python versions. Finally, it will teach you how to access C functions with a simple Python call. By the end of the book, you will be able to write more advanced scripts and take on bigger challenges.

    Style and Approach

    This book is a comprehensive guide that covers advanced features of the Python language, and communicate them with an authoritative understanding of the underlying rationale for how, when, and why to use them.

    Table of Contents

    Chapter 1: Getting Started – One Environment per Project
    Chapter 2: Pythonic Syntax, Common Pitfalls, and Style Guide
    Chapter 3: Containers and Collections – Storing Data the Right Way
    Chapter 4: Functional Programming – Readability versus Brevity
    Chapter 5: Decorators – Enabling Code Reuse by Decorating
    Chapter 6: Generators and Coroutines – Infinity, One Step at a Time
    Chapter 7: Async IO – Multithreading without Threads
    Chapter 8: Metaclasses – Making Classes (Not Instances) Smarter
    Chapter 9: Documentation – How to Use Sphinx and reStructuredText
    Chapter 10: Testing and Logging – Preparing for Bugs
    Chapter 11: Debugging – Solving the Bugs
    Chapter 12: Performance – Tracking and Reducing your Memory and CPU Usage
    Chapter 13: Multiprocessing – When a Single CPU Core Is not Enough
    Chapter 14: Extensions in C/C++, System Calls, and C/C++ Libraries
    Chapter 15: Packaging – Creating Your Own Libraries or Applications

    中文:

    书名:Mastering Python

    通过使用Python3.5提供的所有功能,掌握编写漂亮而强大的Python的艺术

    About This Book

    • 熟悉Python代码样式中最重要和最高级的部分
    • 学习Python的更复杂的方面,并将其放在结构化的上下文中,以便更深入地理解该语言
    • 提供了专家视角的概述,说明这些高级任务如何在整体上配合使用,并提供了实际示例

    Who This Book Is For

    几乎任何人都可以学习编写工作脚本和创建高质量的代码,但他们可能缺乏对成为一名Pythonic意味着什么的结构化理解。如果您是一名希望通过准确掌握几种复杂的Python技术的语法和用法来高效编写代码的Python程序员,这本书是为您准备的。

    What You Will Learn

    • 创建一个虚拟环境并启动一个新项目
    • Understand how and when to use the functional programming paradigm
    • 熟悉编写装饰符的不同方式
    • 了解生成器和协程程序的能力,而无需离题进入Lambda演算
    • 创建元类以及它如何使使用Python变得更加容易
    • 使用Sphinx从文档和代码生成HTML文档
    • 了解如何跟踪和优化应用程序性能,包括内存和CPU
    • Use the multiprocessing library, not just locally but also across multiple machines
    • 对打包和创建自己的库/应用程序有基本的了解

    In Detail

    Python是一种动态编程语言。它以其高可读性而闻名,因此它通常是新程序员学习的第一语言。作为多范例,它可以用来以不同的方式实现相同的事情,并且它是跨平台兼容的。即使您发现编写Python代码很容易,但编写高效、易于维护和重用的代码也不是那么简单。

    这本书是一本权威的指南,将帮助您学习新的先进方法在明确和背景的方式。它首先使用venv创建特定于项目的环境,向您介绍不同的Pythonic语法和常见陷阱,然后再讨论Python中的功能特性。它介绍了如何创建不同的装饰器、生成器和元类。它还向您介绍了函数工具、包装和协程以及它们的工作原理。稍后,您将学习如何将Asyncio模块用于异步客户端和服务器。您还将熟悉不同的测试系统,如py.test、doctest和unittest,以及调试工具,如Python调试器和faulthandler。您将学习如何优化应用程序的性能,使其能够在多台机器和多个版本的Python上高效运行。最后,它将教您如何通过一个简单的Python调用访问C函数。到本书结束时,你将能够写出更高级的剧本,并接受更大的挑战。

    Style and Approach

    这本书是一本全面的指南,涵盖了Python语言的高级功能,并通过对如何、何时以及为什么使用它们的基本原理的权威理解来交流它们。

    Table of Contents

    第1章:入门-每个项目一个环境
    第2章:Pythonic语法、常见陷阱和风格指南
    第3章:容器和集合-以正确的方式存储数据
    第4章:函数式编程-可读性与简洁性
    第5章:装饰器-通过装饰器实现代码重用
    第6章:生成器和协程-无限,一步一步
    第7章:异步IO-无线程的多线程
    第8章:元类-使类(而不是实例)更智能
    第9章:文档-如何使用Sphinx和reStrinredText
    第10章:测试和日志记录-为错误做准备
    第11章:调试-解决错误
    第12章:性能跟踪和减少内存和CPU使用量
    第13章:多处理-当单个CPU内核不够用时
    第14章:C/C++中的扩展、系统调用和C/C++库
    第15章:打包-创建您自己的库或应用程序

  • 下载电子版:下载地址
  • 购买纸质版:亚马逊商城

    点击星号评分!

    平均分 0 / 5. 投票数: 0

    还没有投票!请为他投一票。

  • 推荐阅读

    评论 抢沙发

    评论前必须登录!

     

    登录

    找回密码

    注册