Skip to content

Update variable substitution section of Python docs #3856

@luabud

Description

@luabud

Reported in https://github.com/microsoft/vscode-python/issues/5705

In this section: https://github.com/microsoft/vscode-docs/blob/master/docs/python/environments.md#variable-substitution we mention that any existing environment variable could be used when defining an environment variable. But to make it work we need to add {env:VARIABLE_NAME} instead of {VARIABLE_NAME} for it to work when running Python files in the extension.

For example:

  1. Create .env file with a single line PATH="${PATH};Blah-blah-blah".
  2. Create a Python file with print(os.environ.get('PATH'))
  3. Run Python file with the play button

In this case, ;Blah-blah-blah gets printed. If we change the .env file to get $(env:PATH), then it works. So we should update our docs accordingly

Metadata

Metadata

Assignees

Labels

doc-bugout of date, inaccurate, confusing contentpython

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions