diff --git a/.vscode/vscode.md b/.vscode/vscode.md index e7f529e..9b07c4b 100644 --- a/.vscode/vscode.md +++ b/.vscode/vscode.md @@ -1,6 +1,7 @@ # VSCODE Configuration - [VSCODE Configuration](#vscode-configuration) + - [Debugpy Snippet](#debugpy-snippet) - [Fix Paste (if ctrl+v not working)](#fix-paste-if-ctrlv-not-working) - [Shell](#shell) - [Fonts](#fonts) @@ -8,6 +9,24 @@ - [Extensions](#extensions) - [Continue](#continue) +## Debugpy Snippet + +Use this to add debugging to any project + +```python +# Listens on 5678 +# Only runs if ACTIVATE_DEBUGPY=true is set +if os.getenv("ACTIVATE_DEBUGPY", "").lower() == "true": + try: + import debugpy + debugpy.listen(("0.0.0.0", 5678)) + print("Waiting for client on 5678...") + debugpy.wait_for_client() + print("Client connected") + except Exception as e: + print("DEBUG ERROR: " + str(e)) +``` + ## Fix Paste (if ctrl+v not working) Add to user keyboard settings (json)