How to set the working directory for debugging a Python program in VS Code?
@SpeedCoder5’s comment deserves to be an answer. In launch.json, specify a dynamic working directory (i.e. the directory where the currently-open Python file is located) using: “cwd”: “${fileDirname}” This takes advantage of the “variables reference” feature in VS Code, and the predefined variable fileDirname. Note as comments say, you might also need to add the purpose … Read more