मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग394k · #76

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 पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/openclaw/openclaw/blob/main/skills/python-debugpy/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

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 debugpy in 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 expose 0.0.0.0 unless isolated or tunnelled.
  • Use unique ports for parallel sessions.
  • debugpy --pid injects 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=0 disables breakpoint().
  • 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

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

discord-user-post

394k

यह आपके एजेंट को, आपकी मंज़ूरी के बाद, चैनल की पुष्टि करके आपके नाम से Discord डेस्कटॉप ऐप के ज़रिए संदेश भेजने देती है।

प्रोडक्टिविटीईमेल और मैसेज

discrawl

394k

यह आपके एजेंट को Discord संदेशों के सेव किए गए स्थानीय आर्काइव में खोजने, उसका सारांश बनाने और उसकी ताज़गी जांचने में मदद करती है।

डेटाडेटाबेस

gitcrawl

394k

यह आपके एजेंट को GitHub issues और pull requests के सेव आर्काइव में खोजने, मिलते-जुलते मामलों को समूह में रखने और लाइव स्थिति जांचने देती है।

डेटाएनालिसिस और स्प्रेडशीट

graincrawl

394k

यह आपके एजेंट को सेव की गई Granola मीटिंग नोट्स और ट्रांसक्रिप्ट में खोजने, उनकी ताज़गी जांचने और किसी अवधि के हिसाब से गिनती करने देती है।

लेखन और डॉक्यूमेंटरिसर्च

मिलती-जुलती skills