Vinayak Hosamani
Vinayak Hosamani

Reputation: 97

what is PyCharm Run Edit configuration equivalent in VS code?

In the PyCharm to debug any Python file, following configuration can be added.

Go to Run -> Edit Configurations and click on +
Select Python
Give some name
Provide Script: -> Provide Script parameters: -> <>
Provide Environment variables: -> <>
Provide Python interpreter: -> <>
Provide Working directory: -> <>

So I wanted to know how to add equivalent configuration on VS code launch.json

So far I have got to know below parameters in VS code and remainig parameters I am trying to understand.

  1. Provide Script parameters:
  2. Provide Python interpreter:

Thanks a lot in advance.

Upvotes: 3

Views: 3299

Answers (1)

MingJie-MSFT
MingJie-MSFT

Reputation: 9347

As mentioned in the comments, what you said comes from the docs. You can edit your launch.json file to set it:

Provide Script parameters

args

Specifies arguments to pass to the Python program. Each element of the argument string that's separated by a space should be contained within quotes, for example:

"args": ["--quiet", "--norepeat", "--port", "1593"],

Provide Environment variables

env

Sets optional environment variables for the debugger process beyond system environment variables, which the debugger always inherits. The values for these variables must be entered as strings.

Provide Python interpreter

Python

The full path that points to the Python interpreter to be used for debugging.

If not specified, this setting defaults to the interpreter selected for your workspace, which is equivalent to using the value ${command:python.interpreterPath}. To use a different interpreter, specify its path instead in the python property of a debug configuration.

Provide Working directory

cwd

Specifies the current working directory for the debugger, which is the base folder for any relative paths used in code. If omitted, defaults to ${workspaceFolder} (the folder open in VS Code).

Upvotes: 2

Related Questions