|
|
4 周之前 | |
|---|---|---|
| .. | ||
| tests | 4 周之前 | |
| todo | 4 周之前 | |
| .gitignore | 4 周之前 | |
| PROJECT_SUMMARY.md | 4 周之前 | |
| QUICKSTART.md | 4 周之前 | |
| README.md | 4 周之前 | |
| USAGE.md | 4 周之前 | |
| main.py | 4 周之前 | |
| requirements.txt | 4 周之前 | |
一个简单、高效的命令行待办事项管理工具。
project/
├── todo/
│ ├── __init__.py
│ ├── todo.py # 核心Todo类
│ ├── storage.py # 数据持久化
│ └── cli.py # 命令行界面
├── tests/
│ ├── __init__.py
│ ├── test_todo.py
│ ├── test_storage.py
│ └── test_cli.py
├── main.py # 程序入口
├── requirements.txt # 依赖管理
└── README.md # 项目文档
pip install -r requirements.txt
python main.py add "买菜"
python main.py list
python main.py complete 1
python main.py delete 1
python main.py --help
pytest tests/ -v
待办事项数据存储在 todos.json 文件中,格式如下:
{
"todos": [
{
"id": 1,
"title": "买菜",
"completed": false,
"created_at": "2024-02-08 10:30:00"
}
],
"next_id": 2
}