This article will introduce the usage of the Counter class and compare its performance with dict and defaultdict.
Python Programming - Beginner Level
Python’s os module provides many convenient functions for us to manipulate file/folder paths. After Python 3.4, a new module called pathlib was introduced, which encapsulates various file/folder related operations in classes such as
Path, making file/folder operations more object-oriented.
This article will explain and demonstrate the pathlib module.
The advantage of using multiprocessing is that it can greatly avoid the impact of Python GIL on program performance, but the bad thing is that it consumes more memory. Even so, it is still a module that must be understood.
This article will learn how to use the multiprocessing module through several examples.
Python has been evolving for nearly 10 years, so the development of Python projects also needs to consider the issue of version.
Especially now that Python 2 has retired, most Python projects now use Python 3 as the main version, but some of the old projects in companies still use Python 2 for development, so developers must switch between Python 2 and 3.
If you have trouble switching between Python versions, then pyenv will be your best friend!
Recently when I was looking at the source code of Elastic APM agent for Python, I saw that the developers of the project have used the atexit module to close the metrics collect timer before the APM agent shuts down.
Since I am not very familiar with
atexit, I decided to study it in this article.