question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ampersand (&) character inserted during Run Python File in Terminal. (latest update).

See original GitHub issue

Environment data

  • VS Code version: 1.52
  • Extension version (available under the Extensions sidebar): 2021.1.502429796 (just got upgraded from 2020.12.424452561)
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.9 (default, Aug 31 2020, 17:10:11) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32, conda 4.9.2
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
  • Relevant/affected Python packages and their versions: XXX
  • Relevant/affected Python-related VS Code extensions and their versions: Python v2021.1.502429796, Pylance v2021.1.2
  • Value of the python.languageServer setting: XXX

[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]

Expected behaviour

Python file runs in terminal cmd.exe.

Actual behaviour

F:\Code\test>conda activate stan_env

(stan_env) F:\Code\test>& C:/Anaconda3/envs/stan_env/python.exe f:/Code/test/test.py & was unexpected at this time.

Steps to reproduce:

Run Python File in Terminal with cmd.exe terminal with workspace settings like below.

workspace settings

{
	"folders": [
		{
			"path": "."
		}
	],
	"settings": {
		"python.pythonPath": "C:\\Anaconda3\\envs\\stan_env\\python.exe",
		"python.terminal.activateEnvironment": true,
		"python.condaPath": "C:\\Anaconda3\\Scripts\\conda.exe",
		"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe"

	}
}

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
huntfxcommented, Feb 1, 2021

Sorry, I tried that after, but forgot to restart the shell when testing haha. Yeah it’s back to normal now, thanks 😃

1reaction
oppsigcommented, Jan 26, 2021

@kimadeline, will try out tomorrow and report back!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ampersand "&" syntax error running any Python script in ...
I was able to resolve the issue by downgrading my version of the Python extension to the previous version. It seems like their...
Read more >
using ampersand in set in python - You.com | The AI Search ...
Answer: No, the ampersand is a bitwise 'and' operator in Python, the operator will be parsed out of the name. In general, Python...
Read more >
Using SnowSQL - Snowflake Documentation
This topic describes how to use SnowSQL, including starting/stopping the client, using commands and variables within the client, and other general usage ...
Read more >
Jelly escaping types - Product Documentation | ServiceNow
You use different methods when escaping characters in JavaScript and HTML. ... the backslash character, and HTML uses the ampersand character.
Read more >
__main__ — Top-level code environment — Python 3.11 ...
If you're new to Python modules, see the tutorial section Modules for an introduction. __name__ == '__main__' ¶. When a Python module or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found