Resolve Python Scripts Not Executing from Current Working Directory in Visual Studio Code on Windows - DevPops-Inc/windows GitHub Wiki

• The following is for if Visual Studio Code doesn’t run your Python scripts from your current working directory.
image

• Expand the “File” and “Preferences” menus and select “Settings.”
image

• Type “python terminal” in the search box and select the “Python > Terminal: Execute in File Dir” checkbox.
image

• Close the “Settings” tab.
image

• Press the Run button and the Python script will execute from the same directory it’s saved in.
image