Issue 381

原文: PyCoder’s Weekly - Issue #381 用 Python 进行传统人脸检测 REAL PYTHON video In this course on face detection with Python, you’ll learn about a historically important algorithm for object detection that can be successfully applied to finding the location of a human face within an image. (是也乎: 当然, 现在 BAT 都有自己云 AI 了, 直接调用, 就不用本地生撸了… ) Python 中的三种反转控制技术 DAVID SEDDON Inversion of Control, in which code delegates control using plugins, is a powerful way of modularising software. It may sound complicated, but it can be achieved in Python with very little work. This article examines three different techniques for handling IOC in Python. (是也乎: IoC ~ 委托控制插入… 模块化软件的有效手段, 其实就是插件技术, 只是在代码层面上的… 大约是: 依赖注入,注册,猴补丁, 这几个思路. ) NumPy 1.17.0 不再支持 Python 2 MAIL-ARCHIVE.COM “The 1.17.0 release contains a number of new features that should substantially improve its performance and usefulness. The Python versions supported are 3.5-3.7, note that Python 2.7 has been dropped.” (是也乎: 爱过… ) print() 函式深挖 (17,000 字指南) REAL PYTHON Learn all there is to know about the print() function in Python and discover some of its lesser-known features. Avoid common mistakes, take your “hello world” to the next level, and know when to use a better alternative. (是也乎: 深挖灵魂40层, 当问打印合理无. ) Python 工具环境概述 ADITHYA BALAJI An opinionated guide to tooling in Python covering pyenv, poetry, black, flake8, isort, pre-commit, pytest, coverage, tox, Azure Pipelines, sphinx, and readthedocs. (是也乎: 每年这种文章都得更新一下, 非常值得对比检验自己武器库是否合理的: Python 工具全景图 ) 通过从头开始编写异步 Web 框架来剖析其工作原理 OLEH KUCHUK (是也乎: 叕一则从0 开始, 手撸框架, 只为了嗯哼明白到底什么是重要的 ) 讨论 Discussions ...

2019-08-14 · 5 min · 2360 words · ZoomQuiet

Issue 380

原文: PyCoder’s Weekly - Issue #380 在 Django Admin 中管理用户应该了解的 REAL PYTHON Learn what you need to know to manage users in Django admin. Out of the box, Django admin doesn’t enforce special restrictions on the user admin. This can lead to dangerous scenarios that might compromise your system. (是也乎: 当年的时尚, 今天就变成黑魔法了… ) 为什么你的 Mock 不起作用 NED BATCHELDER “Mocking is a powerful technique for isolating tests from undesired interactions among components. But often people find their mock isn’t taking effect, and it’s not clear why. Hopefully this explanation will clear things up.” (是也乎: 所以, 还是 Docker 中给真东西测试吧 ) Django 安全版本发布: 2.2.4, 2.1.11 and 1.11.23 DJANGOPROJECT.COM Addresses DoS possibilities in django.utils.text.Truncator, strip_tags(), django.utils.encoding.uri_to_iri(), and a potential SQL injection issue in JSONField/HStoreField. (是也乎: 三连发…可见 Django 基金会是真赚銭的… ) PySpark 大数据处理的第一步 REAL PYTHON Take your first steps with Spark, PySpark, and Big Data processing concepts using intermediate Python concepts. 用 Fakes 以及 Factories 改进 Django 测试 MARTIN ANGELOV This blog post is an introduction into unit testing in Django. It offers an explanation on what are faker and factories and code examples illustrating them. Python 中的内存管理 ARTEM GOLUBIN This article describes memory management in CPython 3.6 and how it uses a pool allocator called PyMalloc to speed-up memory operations and reduce fragmentation. (是也乎: 随着 Python 越来越 C++ 化, 内存问题也必然回到程序猿眼前… ) PEP 589 – TypedDict: 带有一组固定键的字典类型提示 PYTHON.ORG 讨论 Discussions ...

2019-08-07 · 4 min · 1924 words · ZoomQuiet

Issue 379

原文: PyCoder’s Weekly - Issue #379 什么是 Python 3.8 将带来的? JAKE EDGE “The Python 3.8 beta cycle is already underway, with Python 3.8.0b1 released on June 4, followed by the second beta on July 4. That means that Python 3.8 is feature complete at this point, which makes it a good time to see what will be part of it when the final release is made.” (是也乎: 已经开始期待 Py 4 了… 在老爹有生之年..应该规划好 Python 42 前所有开发呢. ) PyLint 误报… LUKE PLANT “In some recent discussion on Reddit, I claimed that, for cases where I’m already using flake8, it seemed as though 95% of Pylint’s reported problems were false positives. Others had very different experiences, so I was intrigued enough to actually do some measurements.” 理解 Python Traceback REAL PYTHON Learn how to read and understand the information you can get from a Python traceback. You’ll walk through several examples of tracebacks and see how to handle some of the most common types of exceptions in Python. (是也乎: 正如其名…倒追… ) Django vs Flask in 2019: 框架之选 MICHAEL HERMAN • Shared by Michael Herman In this article, you’ll take a look at the best use cases for Django and Flask along with what makes them unique, from an educational and development standpoint. (是也乎: Bottle 一生推… 不过,商业项目, Django 没问题. ) 字典在 Python REAL PYTHON video In this course on Python dictionaries, you’ll cover the basic characteristics of dictionaries and learn how to access and manage dictionary data. Once you’ve finished this course, you’ll have a good sense of when a dictionary is the appropriate data type to use and know how to use it. Python 3.8.0b3 可用于测试 PYTHON.ORG 讨论 Discussions ...

2019-08-01 · 4 min · 1883 words · ZoomQuiet

Issue 378

原文: PyCoder’s Weekly - Issue #378 创建用 Google 登录的 Flask 应用程序 REAL PYTHON In this step-by-step tutorial, you’ll create a Flask application that lets users sign in using their Google login. You’ll learn about OAuth 2 and OpenID Connect and also find out how to implement some code to handle user session management. (是也乎: 如何基于一个不存在的网站完成用户登录检验? ) Guido 有关 Python 上 PEG Parsers GUIDO VAN ROSSUM “Some years ago someone asked whether it would make sense to switch Python to a PEG parser. [… ] I looked into it a bit and wasn’t sure what to think, so I dropped the subject. Recently I’ve learned more about PEG (Parsing Expression Grammars), and I now think it’s an interesting alternative to the home-grown parser generator that I developed 30 years ago when I started working on Python.” (是也乎: 老爹难得放话了… 有趣, 但是, 只能放弃. ) Pip 决定前前兼容 Python 2.x PYPA.IO “pip will continue to ensure that it runs on Python 2.7 after the CPython 2.7 EOL date. Support for Python 2.7 will be dropped, if bugs in Python 2.7 itself make this necessary (which is unlikely) or Python 2 usage reduces to a level where pip maintainers feel it is OK to drop support. The same approach is used to determine when to drop support for other Python versions.” (是也乎: 顺应民意… 无论 官方是否支持 Py2 代码, 海量 Py2 only 的包是应该长久支持的. ) 日志在 Python REAL PYTHON video Python provides a logging system as a part of its standard library, so you can quickly add logging to your application. In this course, you’ll learn why using this module is the best way to add logging to your application as well as how to get started quickly, and you will get an introduction to some of the advanced features available. (是也乎: 视频教程,如何日志… 不过,这事儿, 在Python 不是太困难, 而是太容易, 以至难以决定用哪种姿势… ) 通过构造复本来理解 Celery 如何工作 KOMU WAIRAGU • Shared by Komu Wairagu “A delayed job processor (also called a background processor, asynchronous task queue, etc.) is a software system that can run code at a later time. Examples of such software includes Celery, Resque, Sidekiq, and others. In this post we will try and understand how these things work by building a clone/replica of such software.” 简化您的 Python 开发人员环境 MASON EGGER • Shared by Python Bytes FM Three tools (pyenv, pipx, pipenv) make for smooth, isolated, reproducible Python developer and production environments. (是也乎: 混合这么多环境管理工具, 怎么叫简洁呢? ) 讨论 Discussions ...

2019-07-24 · 4 min · 1987 words · ZoomQuiet