This project is working in progress.
Rewritten of original project 500 Lines or Less with improvements in the following aspects:
- Code written in
Python2are rewritten inPython3 - Replace some of the outdated content with newer mechanism. For example, HTTP processing pipeline are introduced instead of
CGI - Written in a step-by-step manner, showing actual code for each step, so we can see how to make progress
- Some of the projects are developed in a test-driven (TDD) manner
Project relatived articles are published at My blog, in Chinese language.
To run the program code, you need
Python3. Any version higher thanPython3.6should work (not verified, however). Current development environment isPython3.8.
Code of each project is in a separated directory, naming after the original project. Whitespace or hyphen(-) are replaced with underline(_) for the sake of references in code. For thosed developed in a step-by-step manner, each step also has its own sub-directory.
To run a projects written in Python: open main.py in project root, find the entry point for the project of interest, uncomment it and run.
本项目试图以更加现代化的方式重写 500 Lines or Less 项目,并在以下方面有所改进:
- 将基于
Python2的项目改写为基于Python3 - 删除部分过时的内容,用更适合现实的机制代替。例如,
CGI机制换成了HTTP处理管线 - 用循序渐进的方式编写代码,展示每个具体步骤,让读者能够更好地理解
- 部分项目采用测试驱动(
TDD)的方式开发。
项目相关的介绍文章发布在 作者的博客.
要运行程序代码,需要
Python3。理论上任何高于 Python3.6 的版本均可(但未验证)。目前使用的开发环境是 Python3.8
各个项目分别放在不同的目录下,命名方式遵照原先的名称,为了方便在代码中引用,部分空格或连字符(-)用下划线(_) 替代。对于使用迭代式开发的项目,每个步骤放在单独的目录下。
对于用 Python 实现的项目,请打开项目根目录下的 main.py, 找到特定的项目以及步骤编号,取消注释并运行。