Python
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.

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.

Django Model and E-R Diagram
· ☕ 6 min read
As requirements are gradually confirmed, the system’s DB model is gradually confirmed as well. Sometimes you use a tool like MySQL Workbench to draw an E-R diagram and then generate MySQL database tables, and at that point you need to reverse-generate Django Models; other times you write the Django Models directly, but then you need to look at the E-R diagram.

Django Development Conventions (Part 1)
· ☕ 3 min read
This article mainly lays out a few things to watch out for during Django development. A consistent coding style and sound design principles help a project’s development and maintenance, and are worth developers studying and discussing continuously. 1. Encoding Declaration When the Python interpreter executes code, it needs to be

Processes, Threads, and Coroutines in Python
· ☕ 5 min read
1. Processes A process is an instance of a running program, and it is the most basic unit by which the kernel allocates resources. A process has its own independent heap and stack, its own address space, and its own resource handles. Processes are scheduled by the OS, the scheduling