Mastering Python - Second Edition: Write powerful and efficient code using the full range of Python's capabilities

Hattem, Rick Van

  • 出版商: Packt Publishing
  • 出版日期: 2022-05-20
  • 售價: $1,860
  • 貴賓價: 9.5$1,767
  • 語言: 英文
  • 頁數: 710
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1800207727
  • ISBN-13: 9781800207721
  • 相關分類: Python程式語言
  • 立即出貨 (庫存=1)

買這商品的人也買了...

商品描述

Use advanced features of Python to write high-quality, readable code and packages

Key Features

- Extensively updated for Python 3.10 with new chapters on design patterns, scientific programming, machine learning, and interactive Python
- Shape your scripts using key concepts like concurrency, performance optimization, asyncio, and multiprocessing
- Learn how advanced Python features fit together to produce maintainable code

Book Description

Even if you find writing Python code easy, writing code that is efficient, maintainable, and reusable is not so straightforward. Many of Python's capabilities are underutilized even by more experienced programmers. Mastering Python, Second Edition, is an authoritative guide to understanding advanced Python programming so you can write the highest quality code. This new edition has been extensively revised and updated with exercises, four new chapters and updates up to Python 3.10.

Revisit important basics, including Pythonic style and syntax and functional programming. Avoid common mistakes made by programmers of all experience levels. Make smart decisions about the best testing and debugging tools to use, optimize your code's performance across multiple machines and Python versions, and deploy often-forgotten Python features to your advantage. Get fully up to speed with asyncio and stretch the language even further by accessing C functions with simple Python calls. Finally, turn your new-and-improved code into packages and share them with the wider Python community.

If you are a Python programmer wanting to improve your code quality and readability, this Python book will make you confident in writing high-quality scripts and taking on bigger challenges

What you will learn

- Write beautiful Pythonic code and avoid common Python coding mistakes
- Apply the power of decorators, generators, coroutines, and metaclasses
- Use different testing systems like pytest, unittest, and doctest
- Track and optimize application performance for both memory and CPU usage
- Debug your applications with PDB, Werkzeug, and faulthandler
- Improve your performance through asyncio, multiprocessing, and distributed computing
- Explore popular libraries like Dask, NumPy, SciPy, pandas, TensorFlow, and scikit-learn
- Extend Python's capabilities with C/C++ libraries and system calls

Who this book is for

This book will benefit more experienced Python programmers who wish to upskill, serving as a reference for best practices and some of the more intricate Python techniques. Even if you have been using Python for years, chances are that you haven't yet encountered every topic discussed in this book. A good understanding of Python programming is necessary

商品描述(中文翻譯)

使用Python的高級功能來編寫高質量、可讀性強的代碼和包

主要特點

- 針對Python 3.10進行了廣泛更新,新增了關於設計模式、科學編程、機器學習和交互式Python的新章節
- 使用並發、性能優化、asyncio和多進程等關鍵概念來塑造腳本
- 學習如何將高級Python功能結合起來產生可維護的代碼

書籍描述

即使你覺得編寫Python代碼很容易,但編寫高效、可維護和可重用的代碼並不那麼簡單。許多Python的功能即使對於經驗豐富的程序員來說也被低估。《Python大師》第二版是一本權威指南,旨在理解高級Python編程,以便編寫最高質量的代碼。這本新版書經過廣泛修訂和更新,包括練習題、四個新章節和Python 3.10的更新內容。

重新學習重要的基礎知識,包括Python風格和語法以及函數式編程。避免程序員在各個經驗水平上常犯的錯誤。明智地選擇最佳的測試和調試工具,優化代碼在多台機器和Python版本上的性能,並充分利用常被忽視的Python功能。通過asyncio全面了解並進一步擴展語言,通過簡單的Python調用訪問C函數。最後,將改進後的代碼打包成包並與廣大的Python社區共享。

如果你是一個想提高代碼質量和可讀性的Python程序員,這本Python書將使你在編寫高質量腳本和應對更大挑戰方面充滿信心。

你將學到什麼

- 編寫優雅的Python代碼,避免常見的Python編碼錯誤
- 應用裝飾器、生成器、協程和元類的威力
- 使用pytest、unittest和doctest等不同的測試系統
- 跟踪和優化應用程序的內存和CPU使用情況
- 使用PDB、Werkzeug和faulthandler調試應用程序
- 通過asyncio、多進程和分布式計算提高性能
- 探索流行的庫,如Dask、NumPy、SciPy、pandas、TensorFlow和scikit-learn
- 通過C/C++庫和系統調用擴展Python的功能

這本書適合對Python有一定經驗的程序員,希望提升技能,作為最佳實踐和一些更複雜的Python技術的參考。即使你已經使用Python多年,很有可能你還沒有遇到本書中討論的每個主題。需要對Python編程有良好的理解。

目錄大綱

1. Getting Started – One Environment per Project
2. Interactive Python Interpreters
3. Pythonic Syntax and Common Pitfalls
4. Pythonic Design Patterns
5. Functional Programming – Readability Versus Brevity
6. Decorators – Enabling Code Reuse by Decorating
7. Generators and Coroutines – Infinity, One Step at a Time
8. Metaclasses – Making Classes (Not Instances) Smarter
9. Documentation – How to Use Sphinx and reStructuredText
10. Testing and Logging – Preparing for Bugs
11. Debugging – Solving the Bugs
12. Performance – Tracking and Reducing Your Memory and CPU Usage
13. asyncio – Multithreading without Threads
14. Multiprocessing – When a Single CPU Core Is Not Enough
15. Scientific Python and Plotting
16. Artificial Intelligence
17. Extensions in C/C++, System Calls, and C/C++ Libraries
18. Packaging – Creating Your Own Libraries or Applications

目錄大綱(中文翻譯)

1. 入門 - 每個專案一個環境
2. 互動式 Python 解釋器
3. Pythonic 語法和常見陷阱
4. Pythonic 設計模式
5. 函數式編程 - 可讀性與簡潔性的平衡
6. 裝飾器 - 通過裝飾實現代碼重用
7. 生成器和協程 - 一步一步實現無窮
8. 元類 - 讓類(而不是實例)更智能
9. 文檔 - 如何使用 Sphinx 和 reStructuredText
10. 測試和日誌 - 為錯誤做準備
11. 調試 - 解決錯誤
12. 性能 - 監控和減少內存和 CPU 使用量
13. asyncio - 無需線程的多線程
14. 多進程 - 當單個 CPU 核心不夠用時
15. 科學 Python 和繪圖
16. 人工智能
17. C/C++ 擴展、系統調用和 C/C++ 函式庫
18. 打包 - 創建自己的庫或應用程式