python-debugpy
यह क्या करती है
यह AI एजेंट को pdb और debugpy जैसे Python डीबगिंग टूल से कोड रोकने और उसकी स्थिति जांचने के चरण बताती है। यह उन डेवलपर्स के लिए है जिन्हें Python कोड या सेवाओं के उलझे हुए बग ढूंढने हैं।
कब इस्तेमाल करें
- ✓जब कोई Python स्क्रिप्ट अजीब व्यवहार करे और आपको किसी बिंदु पर उसकी वैल्यू देखनी हो।
- ✓जब कोई Python टेस्ट फ़ेल हो और आप उसे चरण-दर-चरण देखना चाहते हों।
- ✓जब किसी लंबे समय से चल रही Python सेवा को रिमोटली debugger से जोड़ना हो।
Skill का लिंक
https://github.com/openclaw/openclaw/blob/main/skills/python-debugpy/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरी Python स्क्रिप्ट गलत संख्याएं दे रही है। मुझे सही जगह पर रोकने और वेरिएबल की वैल्यू दिखाने में मदद कीजिए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
स्किल सबसे छोटा debugger चुनती है जो समस्या तक पहुंचे, जैसे pdb सत्र या कोड में breakpoint। फिर वह प्रोग्राम में चरण-दर-चरण आगे बढ़ती है, वैल्यू जांचती है और सुधार सुझाती है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Python Debugpy
Use when Python code needs interactive debugging: hidden locals, confusing state mutation, failing tests, subprocesses, long-running services, or remote/headless attach.
Pick the smallest debugger that reaches the bad frame.
Choose
breakpoint(): local code, source edits ok, fastest path.python3 -m pdb: no source edit, launch from the beginning.python3 -m pdb -c continue: stop at an unhandled exception.debugpy: remote/headless process, DAP client, already-running PID, or service startup race.
Commands
python3 -m pdb path/to/script.py arg1
python3 -m pdb -c continue path/to/script.py
python3 -c "import debugpy" || python3 -m pip install debugpy
python3 -m debugpy --listen 127.0.0.1:5678 --wait-for-client path/to/script.py
python3 -m debugpy --listen 127.0.0.1:5678 --wait-for-client -m package.module
python3 -m debugpy --listen 127.0.0.1:5678 --pid <pid>
For source-edit attach:
import debugpy
debugpy.listen(("127.0.0.1", 5678))
debugpy.wait_for_client()
debugpy.breakpoint()
For post-mortem:
import pdb, sys
try:
run()
except Exception:
pdb.post_mortem(sys.exc_info()[2])
raise
pdb
- Flow:
n,s,r,c,q. - Stack/source:
w,u,d,a,l,ll. - Values:
p expr,pp expr,display expr. - Breakpoints:
b file.py:42,b func,b file.py:42, condition,cl <num>. - Mutate/evaluate:
!statement; full REPL:interact.
Rules
- Reproduce with the smallest command/test first.
- Disable parallel test workers for pdb; interactive stdin usually breaks inside worker pools.
- Keep
debugpyin the active env; do not add it as a project dependency unless the project already wants it. - Bind debug servers to
127.0.0.1; do not expose0.0.0.0unless isolated or tunnelled. - Use unique ports for parallel sessions.
debugpy --pidinjects into a running process; confirm the target pid before attaching.- If PID attach fails on Linux, check ptrace/container privileges before changing the target.
- Cleanup before commit:
rg -n 'breakpoint\\(|pdb\\.set_trace|debugpy\\.' --type py. - Rerun the normal project test/gate without the debugger.
PYTHONBREAKPOINT=0disablesbreakpoint().- If a process is stuck after debugger detach, confirm it is not still paused at a breakpoint.
अक्सर पूछे जाने वाले सवाल
क्या मुझे अपना कोड बदलना होगा?
हमेशा नहीं। pdb सत्र बिना सोर्स बदले शुरू हो सकता है, हालांकि कोड में breakpoint तेज़ तरीका है।
क्या यह चल रही सेवा को डीबग कर सकती है?
हां। debugpy चल रही प्रक्रिया से, या शुरू हो रही सेवा से जुड़ सकता है।
क्या debug port खोलना सुरक्षित है?
स्किल debug port के लिए लोकल पता 127.0.0.1 इस्तेमाल करती है, इसलिए वह केवल आपकी अपनी मशीन से पहुंचा जा सकता है।
जानकारी
लेखक का मूल विवरण
Debug Python with pdb, breakpoint(), post-mortem inspection, and debugpy remote attach.
repo: openclaw/openclaw
लोकप्रियता
- GitHub स्टार
- 394k
- रैंकिंग में स्थान
- #76
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
discord-user-post
394kयह आपके एजेंट को, आपकी मंज़ूरी के बाद, चैनल की पुष्टि करके आपके नाम से Discord डेस्कटॉप ऐप के ज़रिए संदेश भेजने देती है।
discrawl
394kयह आपके एजेंट को Discord संदेशों के सेव किए गए स्थानीय आर्काइव में खोजने, उसका सारांश बनाने और उसकी ताज़गी जांचने में मदद करती है।
gitcrawl
394kयह आपके एजेंट को GitHub issues और pull requests के सेव आर्काइव में खोजने, मिलते-जुलते मामलों को समूह में रखने और लाइव स्थिति जांचने देती है।
graincrawl
394kयह आपके एजेंट को सेव की गई Granola मीटिंग नोट्स और ट्रांसक्रिप्ट में खोजने, उनकी ताज़गी जांचने और किसी अवधि के हिसाब से गिनती करने देती है।
मिलती-जुलती skills
executing-plans
311kयह आपके एजेंट को मौजूदा सेशन में लिखी इम्प्लीमेंटेशन योजना को चरण-दर-चरण पूरा करने में मदद करती है, हर चरण के बाद अगला शुरू करने से पहले उसकी जांच करके।
finishing-a-development-branch
311kयह आपके एजेंट को तैयार कोड को टेस्ट चलाकर समेटने में मदद करती है, फिर merge करने, pull request खोलने या branch रखने के साफ़ विकल्प देती है।
receiving-code-review
311kयह आपके एजेंट को कोड समीक्षा की टिप्पणियों को ध्यान से परखने में मदद करती है, कुछ भी बदलने से पहले हर बिंदु को कोड से मिलाकर।