vscode working directory when debugging python

debugging, getcwd, python, visual-studio-code

Solution

try setting "cwd": "", in launch.json,

at least it works in the latest version, I can run python modules from root and subdirectories without changing launch settings (vs.code 1.16.1, python extension 0.7)

Problem

I have a simple problem regarding debugging python script on vscode . When I open a parent directory on vs code that contains multiple children directories and then I open multiple python files from these children directories. I then try to debug these files. the problem is that from the launch.json the cwd is set up to be the parent folder. But I am now running a script in subfolders. and jumping from subfolder to subfolder. So changing the "cwd": "workspaceRoot" every now and then isn't practical for me is there a way that the debugger will always use the current folder of the debugged script file as the current directory?? p.s this question didn't help me stackoverfollow question

Original source

Related problems