python-debug-execution

Installation
SKILL.md

Python Debug Execution Pattern

When executing Python scripts that may fail, use this pattern to surface clear error information and diagnose issues effectively.

Core Technique

1. Execute with Full Error Output

Always run Python scripts with stderr redirected to stdout and echo the exit code:

python3 script.py 2>&1 ; echo Exit code: $?

Why this works:

  • 2>&1 captures both stdout and stderr, ensuring tracebacks are visible
  • echo Exit code: $? reveals the actual exit status for debugging
  • Avoids opaque "command failed" errors that hide the real cause
Installs
1
Repository
hkuds/openspace
GitHub Stars
6.7K
First Seen
13 days ago
python-debug-execution — hkuds/openspace