PythonAlgorithms 项目教程
1. 项目的目录结构及介绍
PythonAlgorithms/
├── .github/
│ └── workflows/
├── algorithms/
│ ├── array/
│ ├── backtracking/
│ ├── bit_manipulation/
│ ├── blockchain/
│ ├── boolean_algebra/
│ ├── cellular_automata/
│ ├── compression/
│ ├── data_structures/
│ ├── digital_image_processing/
│ ├── divide_and_conquer/
│ ├── dynamic_programming/
│ ├── encryption/
│ ├── file_transfer/
│ ├── geometry/
│ ├── graph/
│ ├── greedy_algorithms/
│ ├── hashing/
│ ├── machine_learning/
│ ├── math/
│ ├── matrix/
│ ├── networking/
│ ├── neural_network/
│ ├── other/
│ ├── project_euler/
│ ├── quantum/
│ ├── scheduling/
│ ├── searching/
│ ├── sorting/
│ ├── string/
│ └── web_programming/
├── tests/
│ ├── test_array.py
│ ├── test_backtracking.py
│ ├── test_bit_manipulation.py
│ ├── test_blockchain.py
│ ├── test_boolean_algebra.py
│ ├── test_cellular_automata.py
│ ├── test_compression.py
│ ├── test_data_structures.py
│ ├── test_digital_image_processing.py
│ ├── test_divide_and_conquer.py
│ ├── test_dynamic_programming.py
│ ├── test_encryption.py
│ ├── test_file_transfer.py
│ ├── test_geometry.py
│ ├── test_graph.py
│ ├── test_greedy_algorithms.py
│ ├── test_hashing.py
│ ├── test_machine_learning.py
│ ├── test_math.py
│ ├── test_matrix.py
│ ├── test_networking.py
│ ├── test_neural_network.py
│ ├── test_other.py
│ ├── test_project_euler.py
│ ├── test_quantum.py
│ ├── test_scheduling.py
│ ├── test_searching.py
│ ├── test_sorting.py
│ ├── test_string.py
│ └── test_web_programming.py
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── pyproject.toml
└── requirements.txt
目录结构介绍
- .github/workflows: GitHub Actions 的工作流配置文件。
- algorithms: 包含各种算法的实现。
- tests: 包含各种算法的测试文件。
- .gitignore: Git 忽略文件配置。
- CONTRIBUTING.md: 贡献指南。
- LICENSE: 项目许可证。
- README.md: 项目说明文档。
- pyproject.toml: 项目配置文件。
- requirements.txt: 项目依赖文件。
2. 项目的启动文件介绍
项目的启动文件通常是 main.py
或 app.py
,但在本项目中,由于是算法集合,没有特定的启动文件。每个算法模块可以单独运行。
3. 项目的配置文件介绍
- pyproject.toml: 使用 Poetry 进行依赖管理和项目打包的配置文件。
- requirements.txt: 列出了项目运行所需的 Python 包。
pyproject.toml 示例
[tool.poetry]
name = "PythonAlgorithms"
version = "0.1.0"
description = "A collection of various algorithms implemented in Python."
authors = ["vJechsmayr <v.jechsmayr@gmail.com>"]
license = "MIT"
[tool.poetry.dependencies]
python = "^3.8"
[tool.poetry.dev-dependencies]
pytest = "^6.2.2"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requirements.txt 示例
pytest==6.2.2
以上是