521-530¶
Issue #521 WASM, Python Keywords, PyInstaller, and More April 19, 2022¶
Cite
Build an Editor in Python and WebAssembly
Step-by-step instructions on how to build a code editor in the browser using Python and WebAssembly (WASM), via Pyodide, and CodeMirror.
AMIR TADRISI • Shared by Amir Tadrisi
使用WebAssembly来使web可以运行Python代码
Cite
Modern Flask Boilerplate for SaaS
GITHUB.COM/NUVIC • Shared by Nuvic
这都100多star,还不是前后端分离的。我的flask起步项目咋没有人看
Cite
Packaging PyQt6 Apps for Windows With PyInstaller
It isn’t much fun creating your own desktop applications if you can’t share them with other people: learn how to turn your PyQt6 application into a distributable installer for Windows using PyInstaller and InstallForge.
MARTIN FITZPATRICK
新学到的一个东西是InstallForge,可以把Pyinstaller打包出来的dist文件夹做成一个安装程序,然后可以直接在Windows上安装。
Issue #522 Type Hints in Multi-Version Code, Extras for Enum, Django Users, and More April 26, 2022¶
Cite
Type Hints in Code Supporting Multiple Python Versions
The typing module continues to evolve, with new features in every Python version. This can make it tricky if you’re trying to type code that supports multiple Python versions. Learn just what you can do when you need to support Type Hints in multiple versions.
ADAM JOHNSON
第三方拓展包
Cite
Python’s “Type Hints” Are a Bit of a Disappointment to Me
HACKER NEWS
打不开了
Cite
Python Bidirectional Dictionary
Learn about the Bidict library, a bi-directional dictionary where your keys and your values can both be used to look up an item. This can be a useful tool when dealing with mapped data like country code to country name where you want to look up either side of the relationship.
CHRISTOPHER TAO
用字典的value来获取对应的key,目前想不到啥使用场景,而且还要求value不能重复
Cite
Python 3.11 Preview: Task and Exception Groups
Python 3.11 will be released in October 2022. In this tutorial, you’ll install the latest alpha release of Python 3.11 in order to preview task and exception groups and learn about how they can improve your asynchronous programming in Python.
REAL PYTHON
更好的错误提示和性能优化可是太棒的改进了。Python如果性能优化到性能再上一个量级就真的无敌了。还有这个异步的TaskGroup咋看着这么像进程池的感觉
Issue #523 Dunder Methods, Closing Files, The GIL, and More May 3, 2022¶
Cite
Why Is It Important to Close Files in Python?
Model citizens use context managers to open and close file resources in Python, but have you ever wondered why it’s important to close files? In this tutorial, you’ll take a deep dive into the reasons why it’s important to close files and what can happen if you dont.
REAL PYTHON
简而言之:文件是受操作系统限制的资源
Cite
When Python Can’t Thread: A Deep-Dive Into the GIL’s Impact
Python’s Global Interpreter Lock (GIL) stops threads from running in parallel or concurrently. Learn how to determine the impact of the GIL on your code.
ITAMAR TURNER-TRAURING
结论还是尽量使用多进程还有低级拓展
Cite
Python Shouldn’t Be the Top Programming Language
Discussion of the controversial article Python Is Now Top Programming Language — But Shouldn’t Be
HACKER NEWS
我爱这个评论
Cite
Python Testing With doctest
Python’s doctest module allows you to write unit tests through REPL-like sessions in your doc-strings. Learn how to write and execute doctest code. Also available in video.
MIKE DRISCOLL
感觉只能用于简单的的函数,如果遇到复杂的函数参数,很难用文档写清楚
Issue #524 PyCon US 2022 Wrap-Up, Game Engines, PyScript, and More May 10, 2022¶
Cite
Top Python Game Engines
In this tutorial, you’ll explore several Python game engines available to you. For each, you’ll code simple examples and a more advanced game to learn the game engine’s strengths and weaknesses.
REAL PYTHON
记一下名字就行了 - Pygame - Pygame Zero - Arcade - adventurelib - Ren’Py
Cite
PyScript: Unleash the Power of Python in Your Browser
PyScript was announced at PyCon US 2022, it is a web-based application allowing you to use both Python and HTML to create applications. Discover what it can do and how it was built.
ERYK LEWINSON
前端的IDE又要支持Python的代码提示和高亮了,可把IDE厂商恶心坏了
Cite
Modern Python Performance Considerations
There’s nothing like talking about Python and speed to stir up a conversation. Join this discussion about Jake Edge’s Modern Python performance considerations article.
HACKER NEWS
楼主在bb,下面的人说你别bb
Cite
PEP 690: Lazy Imports
This PEP proposes the ability to defer the execution of imported modules until the moment when an imported object is used. Lazy imports can greatly reduce the overall number of modules initially loaded, improving startup time and memory usage.
PEPS.PYTHON.ORG
惰性导入这个我感觉还是非常有必要的,最好能搞成配置行为,这样跑demo之类的时候很多不用的模块就不用安装和处理了。
Cite
An Overview of Structural Pattern Matching for Python
Python’s match statement, which provides a C-like switch statement (though it is far more than that) was introduced in Python 3.10. Learn the history of the feature, how it is used, and how it works.
JAKE EDGE
简单介绍了一下这个pep,核心观点就是match不是简单的switch,是比switch强大的多的功能,尽管新增了关键字带来了学习成本,但是熟练掌握后会带来很大的便捷
Issue #525 Python's min() and max(), django-rich, Evaluating Dependencies, and More May 17, 2022¶
Cite
Python Language Summit: Python Without the GIL
What’s a language summit without a conversation about the GIL? This HN discussion is all about the “nogil” conversation at the 2022 summit
HACKER NEWS
大家热烈的讨论
Issue #526 Building a URL Shortener, Debug Life, Pigeon Deterrents, and More May 24, 2022¶
Cite
If Programming Languages Were Futurama Characters
A little bit of fun. Evidently Python is Lrrr.... read on to find out why.
JAN SCHAUMANN
???
Issue #527 Not Functions, But Classes; Exploring Scope; All About Asterisks; and More May 31, 2022¶
Cite
import-tracker: Track 3rd Party Dependencies Within a Library
GITHUB.COM/IBM
可以分析第三方包的依赖情况
Issue #528 Django Static Files, Data Cleaning, CPython Strings, and More June 7,¶
Cite
Python News: What’s New From May 2022
REAL PYTHON
3.11的版本变快了,棒棒
Cite
How To Profile Python Code
No matter how good you are, sometimes your code just runs slow. Learning how to properly profile your software to identify and fix bottlenecks is a useful skill. This article talks about what you need to know to measure your code’s performance and how to use the cProfile, profile, and timeit libraries, along with others.
JOHN LOCKWOOD
- cProfile
- profile
- timeit
- line_profiler
- memory_profiler
- scalene
- yappi
Issue #529 PyScript, Debugging in Django, Password Handling, and More June 14, 2022¶
Cite
Python 3.10.5 Bug Release
CPYTHON DEV BLOG
发布了新的在线文档
Issue #530 Objects, Functions, Generators, & Coroutines; Combining Data in pandas; Lazy Imports; and More June 21, 2022¶
Cite
Build Your Python Project Documentation With MkDocs
In this tutorial, you’ll learn how to build professional documentation for a Python package using MkDocs and mkdocstrings. These tools allow you to generate nice-looking and modern documentation from Markdown files and, more importantly, from your code’s docstrings.
REAL PYTHON
发现一个新的库https://mkdocstrings.github.io/,可以从代码注释中提取出文档然后用mkdocs发布
Cite
deny: Python Authorization Library
GITHUB.COM/HOLINNN
小巧方便看起来还不错