Python Cheat Sheets — 技能工具
v1.0.0[自动翻译] Provides functional Python code and detailed answers by fetching and applying proven patterns and examples from pythonsheets.com across core, system, ...
详细分析 ▾
运行时依赖
版本
- Major rewrite: transitioned from topic-summary + rule-based quick reference to a focused, example-driven cheat sheet format. - Removed individual topic files (e.g. classes.md, concurrency.md) in favor of a central fetch-based workflow. - Added references/guidelines.md and references/structure.md to standardize fetching real patterns/examples and code quality. - Strong emphasis on fetching from pythonsheets.com for every task to ensure solutions use battle-tested examples and patterns. - Expanded coverage to include databases, security, ML/LLM workflows, and high-performance computing.
安装命令 点击复制
技能文档
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:
- Look up the relevant topic(s) in Structure to find the matching URL(s)
- Always fetch the URL(s) using WebFetch to get real examples and patterns from the site
- Use the fetched content to:
- 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
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制