Learning
How to Safely Access request from Anywhere in Django
· ☕ 2 min read
In Django, request holds all the information for a single request. Backend processing logic frequently needs information from request. For example, the DRF framework may want to be able to obtain request at any time, or pass some parameters globally. There are third-party Django apps with tools that can satisfy

Python2 Source Code Study: Dictionary and List Implementation
· ☕ 5 min read
1. Why Dictionary Lookups Are Faster Than List Lookups First, take a look at the following piece of code. 1 2 3 4 5 6 7 8 9 10 11 12 13 from time import time t = time() data = [chr(i) for i in range(97, 123)] # data =

Python2 Source Code Study: pyc
· ☕ 8 min read
This article uses the Python 2.7.8 source code as an example. 1. Common File Formats in Python py file A Python source code file, which can be modified with a text editor. pyc file The bytecode file generated after Python source code is compiled. pyw file When a pyc file is executed, a console window appears; when a pyw file is executed, it does not.

PPT Making Guide: Course Notes on the Presentation Part
· ☕ 2 min read
1. Overview Course prerequisite: the logical structure and content of the PowerPoint have already been worked out and written. The course enhances the expressiveness of PowerPoint mainly through the following six parts: Color Text Shapes Charts Slide Master Animation 2. Color 2.1 Understanding Color Hue Chromatic colors, such as purple,

How to Build a PyPI Server with devpi
· ☕ 5 min read
When you install Python packages with pip, it looks up the corresponding package on the https://pypi.python.org/simple/ index by default, then downloads and installs it. But in an intranet environment, or when you need to publish some private packages to designated users, you have to build your own PyPI Server. This post mainly records the process of building a PyPI Server index with the devpi tool, along with some commonly used commands.