There's a --inspect-brk CLI switch awailable in Node.js to pause script execution until debugger is attached to the process. Is there a similar way I can tell Python interpreter to hang on until I attach a debugger?
I know about the PDB's "import pdb; pdb.set_trace()" option. The point is that I want to leverage VSCode built-in debugger in a non-hacky way. So far I've been able to run Python scripts with a "-m pdb" option, attach to it by PID with VSCode, pause the script execution with VSCode debugger before I type "next" into the pdb (somehow this sequence intercepts the control to the VSCode debugger) and I'm in. I know about the option of running the VSCode debugger directly by configuring the launch.json file but it doesn't suite the case where I run the Python script as part of some other shell script. The aforementioned Node.js switch is really helpful in such cases and I wonder if there's anything similar I can do with Python.