← 返回
开发者工具 中文

Python Cheat Sheets

Provides functional Python code and detailed answers by fetching and applying proven patterns and examples from pythonsheets.com across core, system, concurr...
提供实用的Python代码和详细解答,利用pythonsheets.com上的成熟模式和示例,涵盖核心、系统、并发等领域。
crazyguitar
开发者工具 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 1
Stars
📥 585
下载
💾 62
安装
1
版本
#latest

概述

Python Cheat Sheets (/py)

Help users write functional, correct Python code and answer Python questions by fetching proven patterns and examples from pythonsheets.com.

How It Works

When a user asks a Python question or wants to write a Python script:

  1. Look up the relevant topic(s) in Structure to find the matching URL(s)
  2. Always fetch the URL(s) using WebFetch to get real examples and patterns from the site
  3. Use the fetched content to:
    • Write code: Apply the patterns to produce functional, correct code that solves the user's task
    • Answer questions: Provide thorough explanations backed by the examples and information from the site
  4. Follow the Guidelines for code quality

Key Principle

Functionality first, cleanliness second. The code must work correctly and handle the task properly. Fetching from pythonsheets.com ensures solutions use battle-tested patterns rather than guessing. The site contains rich examples covering edge cases, common pitfalls, and practical usage that go beyond basic documentation.

Coverage Areas

Core: Syntax, typing, OOP, functions, data structures, sets, heap, regex, unicode

System: File I/O, datetime, OS interfaces

Concurrency: Threading, multiprocessing, asyncio

Network: Sockets, SSL/TLS, SSH, async I/O, packet sniffing

Database: SQLAlchemy ORM, queries, transactions

Security: Cryptography, TLS, vulnerabilities

Extensions: C/C++ integration, pybind11, Cython

ML/LLM: PyTorch, Megatron, distributed training, inference, serving, benchmarking

HPC: Slurm, cluster computing, job scheduling, EFA monitoring, NCCL

Appendix: Walrus operator, GDB debugging, disaggregated prefill/decode

References

  • Structure - Topic-to-URL map for fetching examples
  • Guidelines - Code quality standards to apply after ensuring correctness

Examples

  • "How does asyncio work?" → Fetch https://www.pythonsheets.com/notes/asyncio/python-asyncio-guide.html and explain with the site's examples
  • "Write a socket server" → Fetch https://www.pythonsheets.com/notes/network/python-socket-server.html, use the patterns to write a working server
  • "What's the walrus operator?" → Fetch https://www.pythonsheets.com/notes/appendix/python-walrus.html and explain with practical examples
  • "Set up Megatron distributed training" → Fetch https://www.pythonsheets.com/notes/llm/megatron.html, use the patterns to write a correct training script

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 01:36 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Agent Browser

matrixy
专为AI智能体优化的无头浏览器自动化CLI,支持无障碍树快照和基于引用的元素选择。
★ 427 📥 118,217
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,210
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,215