万本电子书0元读

万本电子书0元读

顶部广告

Secret Recipes of the Python Ninja电子书

售       价:¥

0人正在读 | 0人评论 9.8

作       者:Cody Jackson

出  版  社:Packt Publishing

出版时间:2018-05-21

字       数:41.0万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Test your Python programming skills by solving real-world problems About This Book ? Access built-in documentation tools and improve your code. ? Discover how to make the best use of decorator and generator functions ? Enhance speed and improve concurrency by conjuring tricks from the PyPy project Who This Book Is For Whether you’ve been working with Python for a few years or you’re a seasoned programmer, you’ll have a lot of new tricks to walk away with. What You Will Learn ? Know the differences between .py and .pyc files ? Explore the different ways to install and upgrade Python packages ? Understand the working of the PyPI module that enhances built-in decorators ? See how coroutines are different from generators and how they can simulate multithreading ? Grasp how the decimal module improves floating point numbers and their operations ? Standardize sub interpreters to improve concurrency ? Discover Python’s built-in docstring analyzer In Detail This book covers the unexplored secrets of Python, delve into its depths, and uncover its mysteries. You’ll unearth secrets related to the implementation of the standard library, by looking at how modules actually work. You’ll understand the implementation of collections, decimals, and fraction modules. If you haven’t used decorators, coroutines, and generator functions much before, as you make your way through the recipes, you’ll learn what you’ve been missing out on. We’ll cover internal special methods in detail, so you understand what they are and how they can be used to improve the engineering decisions you make. Next, you’ll explore the CPython interpreter, which is a treasure trove of secret hacks that not many programmers are aware of. We’ll take you through the depths of the PyPy project, where you’ll come across several exciting ways that you can improve speed and concurrency. Finally, we’ll take time to explore the PEPs of the latest versions to discover some interesting hacks. Style and approach Recipe based approach where each problem is solved with the help of step by step instructions.
目录展开

Title Page

Copyright and Credits

Secret Recipes of the Python Ninja

Packt Upsell

Why subscribe?

PacktPub.com

Foreword

Contributors

About the author

About the reviewer

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Download the color images

Conventions used

Get in touch

Reviews

Working with Python Modules

Introduction

Using and importing modules and namespaces

How to do it...

How it works...

There's more...

Implementing virtual Python environments

Getting ready

How to do it...

How it works...

There's more...

Python package installation options

How to do it...

How it works...

Utilizing requirement files and resolving conflicts

How to do it...

How it works...

There's more...

Using local patches and constraint files

How to do it...

How it works...

There's more...

Working with packages

How to do it...

How it works...

There's more...

Creating wheels and bundles

How to do it...

How it works...

There's more...

Comparing source code to bytecode

How to do it...

How it works...

There's more...

How to create and reference module packages

How to do it...

How it works...

There's more...

Operating system-specific binaries

How to do it...

There's more...

How to upload programs to PyPI

Getting ready

How to do it...

How it works...

Project packaging

How to do it...

Uploading to PyPI

Getting ready

How to do it...

How it works...

Utilizing the Python Interpreter

Introduction

Launching Python environments

How to do it...

How it works...

Utilizing Python command options

How to do it...

How it works...

Interface options

Generic options

Miscellaneous options

See also...

Working with environment variables

How to do it...

How it works...

Making scripts executable

How to do it...

There's more...

Modifying interactive interpreter startup

How to do it...

See also

Alternative Python implementations

How to do it...

There's more...

Installing Python on Windows

Getting ready

How to do it...

Using the Windows Python launcher

How to do it...

Embedding Python with other applications

How to do it...

How it works...

Using alternative Python shells – IPython

Getting ready

How to do it...

There's more...

Using alternative Python shells – bpython

Getting ready

How to do it...

There's more...

Using alternative Python shells – DreamPie

Getting ready

How to do it...

There's more...

Working with Decorators

Introduction

Reviewing functions

How to do it...

How it works...

Introducing decorators

How to do it...

How it works...

Using function decorators

How to do it...

How it works...

Using class decorators

How to do it...

Examples of decorators

Getting ready

How to do it...

How it works...

There's more...

Using the decorators module

How to do it...

How it works...

There's more...

See also

Using Python Collections

Introduction

Reviewing containers

How to do it...

There's more...

Lists and tuples

Dictionaries

Sets

Implementing namedtuple

How to do it...

There's more...

Implementing deque

How to do it...

Implementing ChainMap

How to do it...

Implementing Counters

How to do it...

There's more...

Implementing OrderedDict

How to do it...

Implementing defaultdict

How to do it...

Implementing UserDict

How to do it...

Implementing UserList

How to do it...

There's more...

Implementing UserString

How to do it...

Improving Python collections

How to do it...

Default dictionaries

Named tuples

Ordered dictionaries

Looking at the collections – extended module

Getting ready

How to do it...

setlist

bags

RangeMap

Bijection

Generators, Coroutines, and Parallel Processing

How iteration works in Python

How to do it...

Using the itertools module

How to do it...

Infinite iterators

Combinatoric iterators

Terminating iterators

Using generator functions

How to do it...

How it works...

There's more...

Simulating multithreading with coroutines

How to do it...

There's more...

When to use parallel processing

How to do it...

There's more...

Forking processes

How to do it...

How it works...

There's more...

How to implement multithreading

How to do it...

There's more...

Advantages

Disadvantages

How to implement multiprocessing

How to do it...

There's more...

Working with Python's Math Module

Using the math module's functions and constants

How to do it...

Working with complex numbers

How to do it...

Improving decimal numbers

How to do it...

Increasing accuracy with fractions

How to do it...

Working with random numbers

How to do it...

Using the secrets module

How to do it...

Implementing basic statistics

How to do it...

Improving functionality with comath

Getting ready

How to do it...

Improving Python Performance with PyPy

Introduction

What is PyPy?

Getting ready

How to do it...

There's more...

What is RPython?

How to do it...

Flow restrictions

Object restrictions

Integer types

There's more...

Some real-world examples

How to do it...

There's more...

Python Enhancement Proposals

Introduction

What are PEPs?

How to do it...

There's more...

PEP 556 – Threaded garbage collection

Getting ready

How to do it...

There's more...

PEP 554 – Multiple subinterpreters

How to do it...

How it works...

Channels

There's more...

PEP 551 – Security transparency

Getting ready

General security

Python and security

How to do it...

PEP 543 – Unified TLS API

How to do it...

There's more...

Documenting with LyX

Introduction

Python documentation tools and techniques

How to do it...

Inline comments and the dir command

Using docstrings

How to do it...

There's more...

Using PyDoc help

How to do it...

HTML reports

How to do it...

Using reStructuredText files

Getting ready

How to do it...

Using the Sphinx documentation program

Getting ready

How to do it...

Using LaTeX and LyX document preparation programs

Getting ready

How to do it...

There's more...

Other Books You May Enjoy

Leave a review - let other readers know what you think

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部